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.
Here goes the script.
Thats it. Enjoy sharing your app with your friends in google and facebook 🙂
For code sample refer github