Skip to content

Commit

Permalink
Merge pull request #210 from AppsFlyerSDK/RD-82356/userInvite-bug-fix
Browse files Browse the repository at this point in the history
Rd 82356/user invite bug fix
  • Loading branch information
GM-appsflyer authored Apr 5, 2022
2 parents f387fb2 + fe19220 commit 1180c0e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ private void generateInviteLink(MethodCall call, Result rawResult) {
public void onResponse(final String oneLinkUrl) {
if (mCallbacks.containsKey("generateInviteLinkSuccess")) {
try {
obj.put("userInviteUrl", oneLinkUrl);
obj.put("userInviteURL", oneLinkUrl);
runOnUIThread(obj, "generateInviteLinkSuccess", AF_SUCCESS);
} catch (JSONException e) {
e.printStackTrace();
Expand Down
26 changes: 24 additions & 2 deletions ios/Classes/AppsflyerSdkPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,30 @@ - (void)generateInviteLink:(FlutterMethodCall*)call result:(FlutterResult)result
NSString* referrerName = call.arguments[@"referrerName"];
NSString* channel = call.arguments[@"channel"];
NSString* campaign = call.arguments[@"campaign"];

NSDictionary* customParams = call.arguments[@"customParams"];

//Explicitly setting the values of the parameters to be nil in case they are initially received as <null>.
if (customerID == [NSNull null]) {
customerID = nil;
}
if (referrerImageUrl == [NSNull null]) {
referrerImageUrl = nil;
}
if (brandDomain == [NSNull null]) {
brandDomain = nil;
}
if (baseDeeplink == [NSNull null]) {
baseDeeplink = nil;
}
if (referrerName == [NSNull null]) {
referrerName = nil;
}
if (channel == [NSNull null]) {
channel = nil;
}
if (campaign == [NSNull null]) {
campaign = nil;
}
if(customParams == [NSNull null]){
customParams = nil;
};
Expand Down Expand Up @@ -511,7 +533,7 @@ - (void)initSdkWithCall:(FlutterMethodCall*)call result:(FlutterResult)result{
}

appInviteOneLink = call.arguments[afInviteOneLink];
if(appInviteOneLink != nil){
if (appInviteOneLink != nil && appInviteOneLink != [NSNull null]) {
[AppsFlyerLib shared].appInviteOneLinkID = appInviteOneLink;
}

Expand Down

0 comments on commit 1180c0e

Please sign in to comment.