Skip to content
This repository has been archived by the owner on May 17, 2022. It is now read-only.

J.2 Send Invitation

Hadi Tavakoli edited this page Jun 16, 2019 · 2 revisions

Firebase Invites is deprecated. It's functionality is moved into DynamicLinks ANE.

Send invitations

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");
	}
}

Introduction to Firebase ANEs collection for Adobe Air apps


Get Started with Firebase Core in AIR

  1. Prerequisites
  2. Add Firebase to your app
  3. Add the Firebase SDK
  4. Init Firebase Core
  5. Available ANEs
  6. Managing Firebase iid

Get Started with Analytics

  1. Add Analytics ANE
  2. Init Analytics ANE
  3. Log Events
  4. Set User Properties

Get Started with Crashlytics

  1. Add Crashlytics ANE
  2. Test Your Implementation
  3. Customize Crash Reports
  4. Upload .dSYM for iOS apps

Get Started with DynamicLinks

  1. Add DynamicLinks ANE
  2. Init DynamicLinks ANE
  3. Create DynamicLinks
  4. Receive DynamicLinks
  5. View Analytics

Get Started with Authentication

  1. Add Authentication
  2. Init Authentication
  3. Manage Users
  4. Phone Number
  5. Custom Auth
  6. Anonymous Auth
  7. State in Email Actions
  8. Email Link Authentication

Get Started with FCM + OneSignal

  1. Add FCM ANE
  2. Init FCM ANE
  3. Send Your 1st Message
  4. Send Msg to Topics
  5. Understanding FCM Messages
  6. init OneSignal

Get Started with Firestore

  1. Add Firestore
  2. Init Firestore
  3. Add Data
  4. Transactions & Batches
  5. Delete Data
  6. Manage the Console
  7. Get Data
  8. Get Realtime Updates
  9. Simple and Compound
  10. Order and Limit Data
  11. Paginate Data
  12. Manage Indexes
  13. Secure Data
  14. Offline Data
  15. Where to Go From Here

Get Started with Realtime Database

  1. Add Realtime Database
  2. Init Realtime Database
  3. Structure Your Database
  4. Save Data
  5. Retrieve Data
  6. Enable Offline Capabilities

Get Started with Remote Config

  1. Parameters and Conditions
  2. Add Remote Config
  3. Init Remote Config

Get Started with Performance

  1. Add Performance ANE
  2. Init & Start Monitoring

Get Started with Storage

  1. Add Storage ANE
  2. Init Storage ANE
  3. Upload Files to Storage
  4. Download Files to Air
  5. Use File Metadata
  6. Delete Files

Get Started with Functions

  1. Write & Deploy Functions
  2. Add Functions ANE
  3. Init Functions
Clone this wiki locally