-
Notifications
You must be signed in to change notification settings - Fork 16
J.2 Send Invitation
Firebase Invites is deprecated. It's functionality is moved into DynamicLinks ANE.
Start by building an invitation using the InvitesBuilder Class. While building the invitation object, you can customize it easily. Read the asdoc to know how you can customize it on Android and iOS.
var invitationBuilder:InvitesBuilder = new InvitesBuilder();
invitationBuilder.title = "my Title";
invitationBuilder.msg = "My Message";
invitationBuilder.callToAction = "Join the club!";
invitationBuilder.url = _deepLink;
invitationBuilder.img = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png";
_deepLink
is the DynamicLink URL which you have already created. Read here to know how you can create Firebase deeplinks.
If you are sending the invitation from Android and you wish to target your app's iOS version also, you must pass the OAuth 2.0 client ID of your iOS app to otherPlatformClientId while setting the otherPlatform property to Invites.PROJECT_PLATFORM_IOS
.
Similarly, if you are sending the invitation from iOS and you wish to target your app's Android version, you should pass the OAuth 2.0 client ID of your Android app and set the otherPlatform property to Invites.PROJECT_PLATFORM_ANDROID
.
if (Firebase.os == Firebase.ANDROID)
{
invitationBuilder.otherPlatform = Invites.PROJECT_PLATFORM_IOS;
invitationBuilder.otherPlatformClientId = "143635121902-5j7f6ara6wgafjbb3696in7q5t2lgdeb.apps.googleusercontent.com";
}
else
{
invitationBuilder.otherPlatform = Invites.PROJECT_PLATFORM_ANDROID;
invitationBuilder.otherPlatformClientId = "143635121902-h5hhuj015fe6atc4m7poj7pka5091fp5.apps.googleusercontent.com";
}
Finally call the send function and a native dialog will open for you to choose the contact(s) whom you wish to send the invitation to.
NOTICE: On iOS, users must be signed in using GoogleSignin ANE before the dialog can be opened.
Invites.send(invitationBuilder, onFirebaseInviteResult);
function onFirebaseInviteResult($invitationIds:Array):void
{
if ($invitationIds)
{
trace($invitationIds);
}
else
{
trace("invitation canceled or closed or the user is not signed in with GoogleSignIn ANE");
}
}
Enjoy building Air apps – With ♥ from MyFlashLabs Team
Introduction to Firebase ANEs collection for Adobe Air apps
Get Started with Firebase Core in AIR
- Prerequisites
- Add Firebase to your app
- Add the Firebase SDK
- Init Firebase Core
- Available ANEs
- Managing Firebase iid
Get Started with Authentication
- Add Authentication
- Init Authentication
- Manage Users
- Phone Number
- Custom Auth
- Anonymous Auth
- State in Email Actions
- Email Link Authentication
Get Started with FCM + OneSignal
- Add FCM ANE
- Init FCM ANE
- Send Your 1st Message
- Send Msg to Topics
- Understanding FCM Messages
- init OneSignal
- Add Firestore
- Init Firestore
- Add Data
- Transactions & Batches
- Delete Data
- Manage the Console
- Get Data
- Get Realtime Updates
- Simple and Compound
- Order and Limit Data
- Paginate Data
- Manage Indexes
- Secure Data
- Offline Data
- Where to Go From Here
Get Started with Realtime Database
- Add Realtime Database
- Init Realtime Database
- Structure Your Database
- Save Data
- Retrieve Data
- Enable Offline Capabilities
Get Started with Remote Config
- Add Storage ANE
- Init Storage ANE
- Upload Files to Storage
- Download Files to Air
- Use File Metadata
- Delete Files