View exemplo_webappbot_lib.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://telegram.org/js/telegram-web-app.js"></script> |
View exemplo_webappbot_bot.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('BOT_TOKEN', 'SEU TOKEN'); | |
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/'); | |
function processMessage($message) { | |
// processa a mensagem recebida | |
$message_id = $message['message_id']; | |
$chat_id = $message['chat']['id']; | |
if (isset($message['text'])) { |
View exemplo_webappbot_index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"> | |
<script src="https://telegram.org/js/telegram-web-app.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> | |
<script> | |
function getProducts(){ | |
$.ajax({ | |
type:'GET', |
View exemplo_webappbot_server.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('URL_API','https://api.unsplash.com/search/photos/?client_id=[CLIENT_ID]&query=computer&orientation=landscape&per_page=8'); | |
$response = file_get_contents(URL_API); | |
$json = json_decode($response, true); | |
$images = array(); | |
foreach($json['results'] as $image){ |
View exemplo_googleads_layout.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: const Text( | |
Constants.APP_NAME, | |
), | |
), | |
body: Column( | |
crossAxisAlignment: CrossAxisAlignment.stretch, |
View exemplo_googleads_intersticial.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InterstitialAd? _interstitialAd; | |
void _createInterstitialAd() { | |
InterstitialAd.load( | |
adUnitId: Constants.ADMOB_TEST_INTERSTITIAL_ID, | |
request: const AdRequest(), | |
adLoadCallback: InterstitialAdLoadCallback( | |
onAdLoaded: (InterstitialAd ad) { | |
print('$ad carregado'); | |
_interstitialAd = ad; |
View exemplo_googleads_init.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
WidgetsFlutterBinding.ensureInitialized(); | |
MobileAds.instance.initialize(); | |
runApp(MyApp()); | |
} |
View exemplo_googleads_androidmainfest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<manifest> | |
<application> | |
<!-- Exemplo AdMob app ID: ca-app-pub-3940256099942544~3347511713 --> | |
<meta-data | |
android:name="com.google.android.gms.ads.APPLICATION_ID" | |
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/> | |
</application> | |
</manifest> |
View exemplo_googleads_pubspec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies: | |
google_mobile_ads: ^1.2.0 |
NewerOlder