AppsFlyer invite link (optional)
- This function is used to generate invitation links and obtain information about inviters and invitees. The sharing function is not included. Call other APIs of our SDK or implement the sharing function in another way.
- The game side calls the AppsFlyer invitation link generation interface to generate invitation links for inviters and then shares them on social channels for invitees to click to download and open the game.
- The game side calls the AppsFlyer query reward interface to check whether the current user opens the game through the link and records it to the background.
- For example:(1) for user A, for activity a, A link is generated through the invitation link interface: a1,a1 is provided to User B to open, after User B opens the game through a1 Link, the query reward interface is called back to success = true, indicating that A invites B success records and sends them to the game server.(2) when user B opens the game again through a1 Link, call the query interface, and the query reward interface calls back success = false. (3) User A, for activity B, generates A link through the invitation link interface: b1, after User B opens the game through b1 link, calls the query reward interface,Query reward API callback success = true.
Waking up the invitee's info.plist configuration through the external chain
As follows:
<Key> CFBundleURLTypes</key>
<Array>
<Dict>
<Key> CFBundleTypeRole</key>
<String> Editor</string>
<Key> CFBundleURLSchemes</key>
<Array>
<String> {Small GameCode + FaceBookAppid}</string>
</Array>
</Dict>
</Array>Check GamedreamerResources
Check whether the AppsFlyerDevKey and AppsFlyerOneLinkID in GamedreamerResources.bundle/ GamedreamerConfig.plist exist and are up to date.
<! -- AppsFlyerDevKey -->
<Key>AppsFlyerDevKey</key>
<String>{provided in the SDK package: xxxx}</string>
<! -- AppsFlyerOneLinkID -->
<Key>AppsFlyerOneLinkID</key>
<String>{provided in the SDK package: xxxx}</string>1. The game side calls the AppsFlyer invitation link generation interface
Note: The game client needs to call the verification server interface and the role interface before calling.
Tonal Methods:
- (void)gamedreamerSendInvitation:(invite_channel)chanel
eventKey:(NSString *)eventKey
value:(NSString *)eventValue
complete:(void (^)(BOOL success, NSString *inviteUrl))inviteBack;Note: The game client needs to call the verification server interface and the role interface before calling.
Parameter
| Parameter | Type | Required or not | explain |
|---|---|---|---|
| chanel | NSInteger | No | Default to channel_normal |
| eventKey | NSString | Yes | The Key name of the invitation event is passed in by the game client after both parties have negotiated and determined (note that the naming of key follows URL coding rules) |
| eventValue | NSString | Yes | Invitation event pass-through field. The content format is defined as a json string. |
| inviteBack | Closure | Yes | Generate closure of linked results |
Callback
Complete: ^(BOOL success, NSSString * _ Nonnull inviteUrl) {
code
}| Parameter | Type | Required or not | explain |
|---|---|---|---|
| success | BOOL | Yes | Whether the generation is successful |
| Url invite | NSString | Yes | The generated url, after the client obtains the url, according to the chanel passed in at the time of the call, pulls up the corresponding sharing channel to let the user share the url. |
Example code
[[GamedreamerManager shareInstance] gamedreamerSendInvitation:(channel_normal)
eventKey:@"hw_invite0915"
value:@"{\"inviteTime\":\"1601186935\",\"inviteTag\":\"default\",\"inviteAccountId\":82}"
complete:^(BOOL success, NSString *inviteUrl) {
code
}];2. The game side calls the AppsFlyer query reward interface
Note: The game client needs to call the verification server interface and the role interface before calling.
Calling method:
- (void)gamedreamerInvitationRewards:(void (^)(BOOL success ,NSString *msg))rewardBack;Callback
gamedreamerInvitationRewards:^(BOOL success, NSString * msg) {
code
}| Parameter | Type | Required or not | explain |
|---|---|---|---|
| success | BOOL | Yes | Was the call successful? |
| msg | NSString | Yes | Call information |
Example code
[[GamedreamerManager shareInstance]
gamedreamerInvitationRewards:^(BOOL success, NSString *msg) {
code
}];About the notes when AppsFlyer invites link tests
When the store is not officially applied, that is, it is tested by scheme. Note that every time the invitation link is opened, the browser must clear the webpage cache. As for the reason, it is also the strange behavior on the appsFlyer webpage. Of course, if the application has been officially released to the store,It is possible to ignore this empty browser cache to test the note.