@@ -95,7 +95,7 @@ - (void)initSession:(CDVInvokedUrlCommand*)command
95
95
96
96
if (!error) {
97
97
if (params != nil && [params count ] > 0 && isFromBranchLink) {
98
-
98
+
99
99
NSError *err;
100
100
NSData *jsonData = [NSJSONSerialization dataWithJSONObject: params options: 0 error: &err];
101
101
@@ -136,7 +136,7 @@ - (void)initSession:(CDVInvokedUrlCommand*)command
136
136
[[NSNotificationCenter defaultCenter ] postNotification: [NSNotification notificationWithName: @" BSDKPostUnhandledURL" object: self .deepLinkUrl]];
137
137
}
138
138
self.deepLinkUrl = nil ;
139
-
139
+
140
140
if (command != nil ) {
141
141
[self .commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
142
142
}
@@ -147,7 +147,7 @@ - (void)setMixpanelToken:(CDVInvokedUrlCommand*)command
147
147
{
148
148
149
149
[[Branch getInstance ] setRequestMetadataKey: @" $mixpanel_distinct_id" value: [command.arguments objectAtIndex: 0 ]];
150
-
150
+
151
151
}
152
152
153
153
- (void )setDebug : (CDVInvokedUrlCommand*)command
@@ -208,10 +208,10 @@ - (void)setIdentity:(CDVInvokedUrlCommand*)command
208
208
pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsDictionary: params];
209
209
}
210
210
else {
211
-
211
+
212
212
pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString: [error localizedDescription ]];
213
213
}
214
-
214
+
215
215
[self .commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
216
216
}];
217
217
}
@@ -227,13 +227,14 @@ - (void)userCompletedAction:(CDVInvokedUrlCommand*)command
227
227
{
228
228
NSString *name;
229
229
NSDictionary *state;
230
+
230
231
// if a state dictionary is passed as an argument
231
232
if ([command.arguments count ] == 2 ) {
232
233
name = [command.arguments objectAtIndex: 0 ];
233
234
state = [command.arguments objectAtIndex: 1 ];
234
235
}
235
236
else {
236
- name = ( NSString *) command.arguments ;
237
+ name = [ command.arguments objectAtIndex: 0 ] ;
237
238
}
238
239
239
240
Branch *branch = [self getInstance ];
@@ -245,7 +246,7 @@ - (void)userCompletedAction:(CDVInvokedUrlCommand*)command
245
246
[branch userCompletedAction: name];
246
247
}
247
248
248
- // TODO: need to resolve according to result of userCompletedAction, but no callback version of the method is exposed.
249
+ // TODO: iOS Branch. userCompletedAction needs a callback for success or failure
249
250
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsString: @" Success" ];
250
251
[self .commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
251
252
}
@@ -417,7 +418,7 @@ - (void)createBranchUniversalObject:(CDVInvokedUrlCommand*)command
417
418
- (void )registerView : (CDVInvokedUrlCommand*)command
418
419
{
419
420
int branchUniversalObjectId = [[command.arguments objectAtIndex: 0 ] intValue ];
420
-
421
+
421
422
NSMutableDictionary *branchUniversalObjDict = [self .branchUniversalObjArray objectAtIndex: branchUniversalObjectId];
422
423
BranchUniversalObject *branchUniversalObj = [branchUniversalObjDict objectForKey: @" branchUniversalObj" ];
423
424
@@ -532,7 +533,7 @@ - (void)showShareSheet:(CDVInvokedUrlCommand*)command
532
533
completion: ^(NSString *activityType, BOOL completed) {
533
534
534
535
int listenerCallbackId = [[command.arguments objectAtIndex: 0 ] intValue ];
535
-
536
+
536
537
if (completed) {
537
538
NSLog (@" Share link complete" );
538
539
[branchUniversalObj getShortUrlWithLinkProperties: linkProperties andCallback: ^(NSString *url, NSError *error) {
@@ -542,7 +543,7 @@ - (void)showShareSheet:(CDVInvokedUrlCommand*)command
542
543
}
543
544
}];
544
545
}
545
-
546
+
546
547
CDVPluginResult *shareDialogDismissed = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK];
547
548
548
549
NSMutableDictionary *branchUniversalObjDict = [self .branchUniversalObjArray objectAtIndex: listenerCallbackId];
@@ -615,7 +616,7 @@ - (void)postUnhandledURL:(NSNotification *)notification {
615
616
// We create a JSON string result, because we're unable to handle the url. We will include the url in the return string.
616
617
NSError *error;
617
618
NSString *urlString;
618
-
619
+
619
620
// if ([notification.object respondsToSelector:@selector(absoluteString:)]) {
620
621
SEL selector = NSSelectorFromString (@" absoluteString:" );
621
622
if ([notification.object respondsToSelector: selector]) {
0 commit comments