Skip to content

Commit

Permalink
Merge branch 'RD-82356/userInvite-null-parameters-&-inviteOneLinkID-f…
Browse files Browse the repository at this point in the history
…ix' into HEAD
  • Loading branch information
af-do committed Apr 4, 2022
2 parents f387fb2 + 8415830 commit fe19220
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 fe19220

Please sign in to comment.