FBSDKAppInviteDialog invite successfully sent, but no notifications received - ios

What I'm doing?
I'm trying to send invitation to my Facebook friends using FBSDKShareKit.
Is it working?
YES – but only with test users (and not with real users).
What's the problem?
Getting push notification for the invitation
Getting notification inside Facebook app
Able to see invitation
If app installed then Facebook will redirect to app else will open AppStore for Installation.
These all working fine – but only with test users and not with real users accounts.
Some facts :
My Facebook app is live and publicly available.
The app I'm trying to invite for is not live yet. So I'm using an app id of other app. However this is working (as I've explained above).
With real user accounts its working – showing success once I invite to other users, but they will never receive push and inside app notification about that invitation.
Your suggestions ?
As you know this is something really strange ! Its working with test users and not with real users, what I'm doing wrong?
Any thing that I'm missing?
How do I make sure that it'll surely work with real accounts when my app will go live!

The answer to my question I got while writing the question, as I've written it too long, I decided to keep it here and give a answer.
I was not getting push/notifications for real users as I'm trying to invite the users who've already authorised my app. As it require for those real users to remove my app from their Facebook's Settings [Settings > Apps] and then if I'll send him a request they will get it.

Related

Invite person from contacts who doesn't have app?

I want to let users of my iPhone app invite people from their contacts to a group they're creating. I can use deeplinks for people that already have the app installed to have an invitation automatically show up, but I was wondering if I can somehow pass custom information to someone downloading the app for the first time so after they initially open the app they'll have an invite waiting.
As far as I can tell this is impossible but I was wondering if there's any other way to somehow associate a contact with that person making an account on their own device. My application uses gmail authentication for account creation so if everybody had each other's gmails saved in their contact this might be possible, but that's not the case unfortunately. If I could get a user's phone number then it would be easy but I know that's not allowed without specifically asking the user.
Does anybody know if it's possible to do something like deeplinking for people installing the app for the first time?
You can do this with Google Firebase Dynamic Links. Google has a guide for this here:
https://firebase.google.com/docs/dynamic-links/
If I understand the question correctly, here is what I'd do:
Scenario: Send Invite
If the email invited by a user is a registered email, done.
If the email invited by user is not a registered email, store it in a separate table (pending invites)
Scenario: Sign up/ Sign in
User registers using email, store user information.
When the user logs in, check if email exists in pending invites table, if exists, present invitation.
Delete user from pending invites table
Not sure if you have it already but you might need a db table to keep the invitations sent by your users.
What you're describing is called Deferred Deep Linking (Deep Linking refers to using a link to open your app directly to a specific piece of content, and Deferred means that it works even if the app isn't installed first).
As you noted, there's no native way to accomplish this on either iOS or Android. URL schemes don't work, because they always fail with an error if the app isn't installed. Apple's newer Universal Links in iOS 9+ get closer in that they at least don't trigger an error if the app isn't installed, but you'd still have to handle redirecting the user from your website to the App Store. You can't pass context through to the app after install with Universal Links, so you wouldn't be able to present the invitation. Additionally. Universal Links actually aren't supported in a lot of places.
To make this work, you need a remote server to close the loop. You can build this yourself, but you really shouldn't for a lot of reasons (not the least of which being you have more important things to do). Free services like Branch.io (full disclosure: Branch is so awesome I work there) and Firebase Dynamic Links are designed to solve exactly this requirement, and can handle all of the backend infrastructure for deferred deep linking so you don't have to. From your perspective, as the developer, you'll seamlessly get exactly the same data to work with whether or not the app was installed when the link was clicked.

Check for Facebook permission approval in Unity3d before trying to login the user

I am working on an Unity3d app an I need the user to be able to post screenshots to his wall. I am currently using Facebook sdk v6.0.
I am trying to get my "publish_actions" request approved. My problem lies in the iOS deployment. Facebook request either a simulator build or an app already uploaded to the App Store. Since the first option is not available since my app does not behave well in the simulator, I would like to implement the Facebook screenshot feature and upload the new release to the App Store.
My idea is to check wether the permissions has been granted or not before trying to log the user. With this method I would avoid ugly messages from Facebook and instead of that, I would show a message stating that "this feature will be available soon". As soon as the Facebook app has been approved and permissions granted, the app will automatically allow the users to log in.
Any ideas on how could I check if the publish_actions permission has been approved before trying to log in the user?
Thank you very much in advance.
Kind regards,
Aernarion

Am I supposed to first release my iOS game and THEN submit it for Facebook review?

I want my game to be able to post to your Facebook wall. For this, I made a Facebook Developer app, and fed the API key to the SDK. It works.
I noticed that there is a "Submit for app review" button in the Facebook app page. Since all I want is to post to someone's wall (which I managed to do already), is it necessary to do this? Can I simply leave the Facebook app alone, or is there like a time period before it gets deleted or something?
Nope - you need to "Submit for app review" and getting it approved by Facebook before you sent your app for publication on the Apple App store. In fact at the moment your app is running in sandbox mode - that means that it works only using your FB account or the FB account of any other developer/tester you might have added to your app via the Facebook Developers website. If you try to perform a FB login within your app using a different account, at this stage you will receive an error (you can easily test it).
If your concern is about - how will they test my app if that is not release yet? Well they won't test it - the only thing that the Facebook team will check is that your Facebook App page is complies with all their requirements - therefore be careful to upload a logo of the right size, without a background, etc (they have a series of rules to follow).

when to properly store or delete users device token

Okay so im coding this app in iOS. Got the Push Notifications down pretty good. I just have one question. Would it be wise of me to store a users device token when they login and delete it when they logout, or keep it forever and basically only update it when a user logs in.
I guess what im seeking is.. best practices for storing and renewing device tokens.
My main issue is this.. when a user logs out... dont they expect to no longer receieve push notifictions. How does facebook approach this? From my understanding if i log out of my FB account through the FB app. It no longer sends me Notifications, am i correct? Im not a big FB user lol
I store mine using NSUserDefaults when the user logs in (and send it to my back end) and then delete it when the user logs out. Multiple reasons for this, A: It could change, there aren't really any specific docs saying if it will remain the same across devices with a backup/restore (but NSUserDefaults will). B. Also if a different user logs in on the same device you'll want the device token to then be connected to that user.
In the didRegisterForRemoteNotificationsWithDeviceToken you can check to see if the device token is the same as the one stored in userdefaults and update it if need be.
Generally speaking if the user logs out they no longer expect to receive notifications. And certainly if another user logs in on their device, they expect to receive notifications for that user. And yes this is how FB App works, or really any social media app. You wouldn't expect to get notifications if you are logged out.

How to invite all facebook friends from ios or android app after ios sdk 3.2

I'm trying to find a best way to send invitation to facebook friends from iOS App.
In the recent api release, I found facebook is restricted the invite policy.
After searching around, I summarize my finding here:
Feed (Graph API user/feed) is used to post message on user's own wall, then friends could seen from their own portal if the feed has mention the friends.
Pro: message could be customized and including pictures etc.
Con: mention 10 people max, also need user interaction in app.
If user just post a message in their own wall, only friends comes to his page could see it, but not possible for notifying friends.
Request (Graph API user/apprequests) is used to send an request directly to friends, there are two kinds of request: User to User and App to User
User to User request scenarios (I'm interested in the first scenario)
The recipient is a friend of the sender and has not installed the app. This is considered an Invite.
Pro: Seems the proper way of invite, friends will receive notification and popup.
Con: Includes maximum 50 friends, and also need user interaction.
The recipient is a friend of the sender and has installed the app.
The recipient has installed the app. In this case the sender and recipient do not need to be friends.
App to User Request: friends will receive a message from the app, but the message is only sent to user who already has the app installed, so this is not useful to me.
So it seems my best shot is to use User to User request. So my app could provide user a list of 50 and ask him/her to confirm sending in the facebook webdialog. But what if user want to request to all their friends, sometimes 500+. Seems facebook is tighten this up to promote their Mobile App Install Ads, or App Center. Ads is another topic. I already have the App Center setup, but how should I let user's friends know about this?
I've been searching for three days, but couldn't get a ideal solution. Folks, suggestions or solution? Thanks in advance!
I've been looking into ways to do this myself and my strong suspicion is that Facebook are trying to discourage / deprecate this feature.
They haven't yet updated the 'Requests' system into their new API (you have to include the old headers to do it), despite pretty much all other features being ported over to the new system.
As you mention, they now have mobile app install ads which they're quite keen to push
And finally, Open Graph: personally, whilst as a developer I'd love to give people the option for people in my app to invite their friends over Facebook, as a user I can see why this would be annoying.
There's a large potential for these requests to be spammy if sent to many users at a time, and also they're quite unnatural, they go against the idea of OG which is that, your friends actions are fluidly put onto their wall where you can see it and choose to investigate / install the app yourself if it sounds interesting.
i.e. the idea now is that app promotion on Facebook is done more naturally and encouraged by usage rather than explicitly forcing requests

Resources