I am working on a new android app and I want to integrate the 'Invite Friends' from fb in order to invite them to use the app. I have added the required code in the app, I've also created the app in the developer portal from Facebook, but users are not getting the notification if I share it.
I tried to also add the user in the settings -> tester users and yet no notification for them.
Can someone help me on this? I over searched the internet, but I could find an answer on this.
Code used for opening the sharing dialog:
private void InviteFriends()
{
if (AppInviteDialog.CanShow())
{
var content = new AppInviteContent.Builder()
.SetApplinkUrl(Resources.GetString(Resource.String.app_url))
//.SetPreviewImageUrl(previewImageUrl)
.Build();
AppInviteDialog.Show(this, (AppInviteContent)content);
}
}
Thank you in advance,
Alex
Related
I am developing an app, in that i want to give an option for users, to invite friends, for installing this app. I am not getting how to do that.
If anyone have any idea please tell me.
You can implement this feature using App Invite option offered by Firebase.
Send and Receive Firebase Invites from Your Android App
This will help you in achieving your app sharing functionality easily.
Below are the steps that you will need to implement.
1. Add the dependency for Firebase Invites to your app-level build.gradle file:
compile 'com.google.firebase:firebase-invites:9.4.0'
2. Send invitations on button click :
private void onInviteClicked() {
Intent intent = new AppInviteInvitation.IntentBuilder(getString(R.string.invitation_title))
.setMessage(getString(R.string.invitation_message))
.setDeepLink(Uri.parse(getString(R.string.invitation_deep_link)))
.setCustomImage(Uri.parse(getString(R.string.invitation_custom_image)))
.setCallToActionText(getString(R.string.invitation_cta))
.build();
startActivityForResult(intent, REQUEST_INVITE);
}
You can customize your invite further by referring the above link.
I have created an android app that I haven't yet published to google play but I want to implement facebook app invites. I read the documentation on facebook but I just couldn't get what this app link url is and how to generate it using app link tool since I am not hosting any website for this app link url. Could somebody help me please?
String appLinkUrl, previewImageUrl;
appLinkUrl = "applinkurl";
previewImageUrl = "imageurl";
if (AppInviteDialog.canShow()) {
AppInviteContent content = new AppInviteContent.Builder()
.setApplinkUrl(appLinkUrl)
.setPreviewImageUrl(previewImageUrl)
.build();
AppInviteDialog.show(this, content);
}
I don't have any website and neither have I published my app on google play..... suppose just for the sake of testing I use any of google play's app link. could you explain now?
The applink url allows you to encode 3 pieces of information per native platform:
The app's name
How to open the app if it's installed
How to install the app if it's not installed
This way, you can give app invites a single URL rather than 3 different pieces of information. It also gives you control to change that info later on.
If you don't have a website, you can go use this tool which will create a URL for you: https://developers.facebook.com/tools/applinkshost
we are using facebook unity sdk game requests on android.
when someone clicks a game request in their facebook notifications
they switch to the game or the app store page (if it's not installed)
when the game runs, we call FB.GetAppLink(DeepLinkCallback)
however, we receive empty url.
anyone knows how to achieve this ?
Thanks.
Full code:
void AfterInit(){
FB.GetAppLink(DeepLinkCallback);
}
void DeepLinkCallback(IAppLinkResult result) {
Debug.Log("app url = "+result.Url);
}
Update:
Sorry For posting the same code. I have a question for you.
Is your app life in the store and linked to Facebook developer profile correctly? If is in test mode it can fail.
However I believe that the ID you need to send in-app invites is the app ID from Facebook developer profile.
(check the image)
Facebook developer profile
the example code for the in-app invites is this
FB.Mobile.AppInvite(
new Uri("https: // fb. me/810530068992919"), //the ID
new Uri("http://i.imgur.com/zkYlB.jpg"), // optional image
AppInviteCallback //callback function
);
Hope that this can solve your issues.
Thanks.
I have imported the Facebook Demo into netbeans and followed the guidelines as mentioned in the developer guide and as well as set required facebook permissions. But I'm failing to share the text on to the wall, where as am able to retrieve friends list, profile info and news feed.
final ShareButton share = new ShareButton();
final TextArea t = new TextArea(" This is sample text from using CodenameOne api");
t.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
share.setTextToShare(t.getText());
}
});
c.addComponent(BorderLayout.CENTER, t);
share.setTextToShare(t.getText());
Is there anything which im missing to integrate or set any additional permissions?
You need to be clear if this is in the device or in the simulator. On iOS/Android the native share functionality is used and the behavior is very different from the simulator.
Facebook recently made changes to the way permissions work and essentially blocked support for non-iOS/Android platforms. This still worked after the blocks but its possible that it stopped.
I am building an android app which needs to share some content (image + text) to Facebook, using facebookDialog. The dialog works perfectly when using a Facebook developer account, but when using a regular account, the dialog appears and then disappears instantly. I have tried passing FORCE_DIALOG_AUTH, as i have seen in some similar posts, but in the best case it just keeps the dialog opened a couple more seconds. Code is pretty straight-forward:
FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(getActivity())
.setLink("https://developers.facebook.com /android").setDescription("a description")
.setPicture(mPlant.default_document().getServerImagePath())
.build();
LE: it looks like the dialog only works with the developer account which generated the app id, the problem is with any other fb account
Thanks in advance
> hope this image makes it clear that unless you make this app live you
> cannot test it from other account.
> There are solutions to add tester
> accounts if you want to test it from any other account instead of developer account,
> then in "Roles" tab add a tester account,then test
> through this account.
Please provide error log so that it's easy to find your bug. But while using Facebook SDK in your app, you need to follow a few procedures:
Register your app on Facebook. After registering you will get a Facebook ID.
After that you need to provide your apps package name and class name in which you are using Facebook.
You need to add your hash key to the Facebook setting page.
Found the answer. It needed Facebook app to be updated. strange thing at least they could have propagated correct message that could have save our time.
I tried restarting my `phone but didn't work. I tried same source code on different 'phone and everything started working. I have no clue on what's wrong in the phone that I was working with.
Hope this could help someone.