This file contains hidden or 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 ACCESS TOKEN'); | |
define('VERIFY_TOKEN', 'SEU VERIFY TOKEN'); | |
$hub_verify_token = null; | |
//-----VEFICA O WEBHOOK-----// | |
if(isset($_REQUEST['hub_challenge'])) { | |
$challenge = $_REQUEST['hub_challenge']; |
This file contains hidden or 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
{ | |
"object":"page", | |
"entry": | |
[{ | |
"id":"320753758271687", | |
"time":1471957860368, | |
"messaging": | |
[{ | |
"sender":{ | |
"id":"USER_ID" |
This file contains hidden or 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 | |
require('parser.php'); | |
define('BOT_TOKEN', 'SEU ACCESS TOKEN'); | |
define('VERIFY_TOKEN', 'SEU VERIFY TOKEN'); | |
define('API_URL', 'https://graph.facebook.com/v2.6/me/messages?access_token='.BOT_TOKEN); | |
$hub_verify_token = null; |
This file contains hidden or 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
{ | |
"recipient":{ | |
"id":"SENDER_ID" | |
}, | |
"message":{ | |
"text":"MENSAGEM" | |
} | |
} |
This file contains hidden or 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
compile 'com.google.android.gms:play-services-ads:9.8.0' |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="br.com.luizmarcus.exemploadmob"> | |
<uses-permission android:name="android.permission.INTERNET"/> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/activity_main" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="br.com.luizmarcus.exemploadmob.MainActivity"> | |
<TextView | |
android:layout_width="wrap_content" |
This file contains hidden or 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
AdView adView = (AdView)findViewById(R.id.adView); | |
AdRequest adRequest = new AdRequest.Builder().build(); | |
adView.loadAd(adRequest); |
This file contains hidden or 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
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
initAds(); | |
} |
This file contains hidden or 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 | |
//https://developers.facebook.com/docs/messenger-platform/account-linking | |
define('BOT_TOKEN', 'EAACmZAGF3rLkBAP1ZAeiUWnUXSkDtroxJ3OZBz1gHgScvB1YBUagg9iZCSQyFfKec76shZBmMcoqAD5MiRbPJQBxDDZBHZCGHsZAvfGSQUYC8ZBtZC0sEEhtEjmG1xuhpzEEptJsxJXhPfJDVMsoEGt60PWPpY1oYNEGu3KZB0uzfLKPgZDZD'); | |
define('VERIFY_TOKEN', 'teste'); | |
define('API_URL', 'https://graph.facebook.com/v2.6/me/messages?access_token='.BOT_TOKEN); | |
$hub_verify_token = null; | |
function processMessage($message) { |