Reputation: 2474
I have created a game in Unity3D and installed the Facebook SDK for Unity. I want to use the Facebook SDK for a very simple purpose, to track the app installs and the app launches, I do not require the Facebook Login or any other features.
When I published the game from Unity to iOS everything worked as expected, however, when publishing the game to Android, the events were not being registered by Facebook.
After posting this question Facebook Android SDK not registering installs @MingLi pointed out that either the Facebook Native app needs to be installed, and when I installed the native app the events started registering!
When the Native FB app is not installed I get this error:
Warning: Sessionless Request needs token but missing either application ID or client token
I have tried searching for a solution for that error, but nothing that I could find solves it without having the Native app installed.
How can I get the Facebook SDK to register events on Android when the Native app is not installed on the users device, like it works in iOS? Many thanks and TIA!
Upvotes: 0
Views: 1221
Reputation: 15662
Basically, when you log an app event, you need to tell FB something about your app (otherwise the event will never get attributed to your app). If you don't have a Session, then you'll need either an app ID (at the very least), or a client token.
For app ID, you can either have it in your AndroidManifest.xml and strings.xml, or you can call Settings.setApplicationID() directly.
For client token, you can similarly call Settings.setClientToken().
Upvotes: 1