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
| Intent intent = new AppInviteInvitation.IntentBuilder("Send App Invitation") | |
| .setMessage("Special season for this app is starting now, try it and get 100 baht") | |
| .setDeepLink(Uri.parse("http://example.com/offer/100_baht")) | |
| .setEmailHtmlContent("<a href='%%APPINVITE_LINK_PLACEHOLDER%%'><h1>Check it out here!</h1><img src='https://appjoy.org/wp-content/uploads/2016/06/firebase-invites-logo.png'></a>") | |
| .setEmailSubject("Firebase Invites want to give you 100 baht") | |
| .build(); | |
| startActivityForResult(intent, REQUEST_INVITE); |
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
| @Override | |
| protected void onActivityResult(int requestCode, int resultCode, Intent data) { | |
| super.onActivityResult(requestCode, resultCode, data); | |
| Log.d(TAG, "onActivityResult: requestCode=" + requestCode + ", resultCode=" + resultCode); | |
| if (requestCode == REQUEST_INVITE) { | |
| if (resultCode == RESULT_OK) { | |
| // Get the invitation IDs of all sent messages | |
| String[] ids = AppInviteInvitation.getInvitationIds(resultCode, data); | |
| for (String id : ids) { |
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
| // Check for App Invite invitations and launch deep-link activity if possible. | |
| // Requires that an Activity is registered in AndroidManifest.xml to handle | |
| // deep-link URLs. | |
| FirebaseDynamicLinks.getInstance().getDynamicLink(getIntent()) | |
| .addOnSuccessListener(this, new OnSuccessListener<PendingDynamicLinkData>() { | |
| @Override | |
| public void onSuccess(PendingDynamicLinkData data) { | |
| if (data == null) { | |
| Log.d(TAG, "getInvitation: no data"); | |
| return; |
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
| <activity android:name=".DeepLinkActivity"> | |
| <intent-filter> | |
| <action android:name="android.intent.action.VIEW"/> | |
| <category android:name="android.intent.category.DEFAULT"/> | |
| <category android:name="android.intent.category.BROWSABLE"/> | |
| <data | |
| android:host="example.com" | |
| android:scheme="http"/> |
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
| FirebaseDynamicLinks.getInstance().getDynamicLink(getIntent()) | |
| .addOnSuccessListener(this, new OnSuccessListener<PendingDynamicLinkData>() { | |
| @Override | |
| public void onSuccess(PendingDynamicLinkData data) { | |
| if (data == null) { | |
| Log.d(TAG, "getInvitation: no data"); | |
| return; | |
| } | |
| Log.d(TAG, "DeepLink: " + data.getLink()); |
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
| 'use strict'; | |
| const functions = require('firebase-functions'); | |
| const request = require('request-promise'); | |
| const notifyLine = (lineMessage, stkPkgId, stkId) => { | |
| return request({ | |
| method: `POST`, | |
| uri: `https://notify-api.line.me/api/notify`, | |
| headers: { |
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
| { | |
| "type": "bubble", | |
| "direction": "ltr", | |
| "styles": { | |
| "header": { | |
| "backgroundColor": "#ffaaaa", | |
| }, | |
| "body": { | |
| "backgroundColor": "#aaffaa", | |
| "separator": true, |
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
| { | |
| "type": "carousel", | |
| "contents":[ | |
| { | |
| "type": "bubble", | |
| "styles": {}, | |
| "body": {}, | |
| "footer": {} | |
| }, | |
| { |
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
| { | |
| "type": "bubble", | |
| "header": { | |
| "type": "box", | |
| "layout": "vertical", | |
| "contents": [ | |
| { | |
| "type": "text", | |
| "text": "header" | |
| } |