Implementing invite to app functionality for Facebook and Google Plus in Cordova application

Ranjith Varma

1 min read

To invite the friends on facebook and google is difficult in cordova app as it has to support through all the platforms; it is safer to use the javascript, to do the invite process
The idea is to open the invite dialog boxes through the instance of browser
First we will see how we can do the invite in Facebook;
1.Firstly, you need to create a facebook app by specifying the app as a game ; to do this
1.a. Open the facebook developer console by clicking this link
1.b. Go to My Apps in the top bar and click add new app
1.c. Then it will show a popup containing options ios,android,facebook canvas,website choose website from the option
1.d. Type the name of your new app in the text field and click create new facebook appid
1.e. In the category field choose games and select a subcategory as desired (subcategory doesn’t matters) and click create app id
1.f. After creating app id, scroll down and specify the website url and the mobile site url
1.g Thats it and now you have created the fb app. Go to my apps and choose the newly created app and copy and save the appid
Then in the code

NB:You have to create your own app for development purpose if the app has to go into production, you have to make the app live by submitting it to facebook through proper way. For this, please refer the link. Also, your app must go live for the sender to see the notification. However if you want to test the app, you can add them as administrators of your facebook app.
Now, lets look how to do the same in google plus.
For google plus, there is no invite feature. The idea here is to share the app to particular friend/friends you need to invite. For this purpose, we dont need to create an app in google. We require simple javascript to perform this operation.
Here goes the script.
 

Thats it. Enjoy sharing your app with your friends in google and facebook 🙂
For code sample refer github
screenshots

23
45

5

Related posts:

Leave a Reply

Your email address will not be published. Required fields are marked *