@@ -95,7 +95,7 @@ - (void)initSession:(CDVInvokedUrlCommand*)command
9595
9696 if (!error) {
9797 if (params != nil && [params count ] > 0 && isFromBranchLink) {
98-
98+
9999 NSError *err;
100100 NSData *jsonData = [NSJSONSerialization dataWithJSONObject: params options: 0 error: &err];
101101
@@ -136,7 +136,7 @@ - (void)initSession:(CDVInvokedUrlCommand*)command
136136 [[NSNotificationCenter defaultCenter ] postNotification: [NSNotification notificationWithName: @" BSDKPostUnhandledURL" object: self .deepLinkUrl]];
137137 }
138138 self.deepLinkUrl = nil ;
139-
139+
140140 if (command != nil ) {
141141 [self .commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
142142 }
@@ -147,7 +147,7 @@ - (void)setMixpanelToken:(CDVInvokedUrlCommand*)command
147147{
148148
149149 [[Branch getInstance ] setRequestMetadataKey: @" $mixpanel_distinct_id" value: [command.arguments objectAtIndex: 0 ]];
150-
150+
151151}
152152
153153- (void )setDebug : (CDVInvokedUrlCommand*)command
@@ -208,10 +208,10 @@ - (void)setIdentity:(CDVInvokedUrlCommand*)command
208208 pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsDictionary: params];
209209 }
210210 else {
211-
211+
212212 pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString: [error localizedDescription ]];
213213 }
214-
214+
215215 [self .commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
216216 }];
217217}
@@ -227,13 +227,14 @@ - (void)userCompletedAction:(CDVInvokedUrlCommand*)command
227227{
228228 NSString *name;
229229 NSDictionary *state;
230+
230231 // if a state dictionary is passed as an argument
231232 if ([command.arguments count ] == 2 ) {
232233 name = [command.arguments objectAtIndex: 0 ];
233234 state = [command.arguments objectAtIndex: 1 ];
234235 }
235236 else {
236- name = ( NSString *) command.arguments ;
237+ name = [ command.arguments objectAtIndex: 0 ] ;
237238 }
238239
239240 Branch *branch = [self getInstance ];
@@ -245,7 +246,7 @@ - (void)userCompletedAction:(CDVInvokedUrlCommand*)command
245246 [branch userCompletedAction: name];
246247 }
247248
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
249250 CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsString: @" Success" ];
250251 [self .commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
251252}
@@ -417,7 +418,7 @@ - (void)createBranchUniversalObject:(CDVInvokedUrlCommand*)command
417418- (void )registerView : (CDVInvokedUrlCommand*)command
418419{
419420 int branchUniversalObjectId = [[command.arguments objectAtIndex: 0 ] intValue ];
420-
421+
421422 NSMutableDictionary *branchUniversalObjDict = [self .branchUniversalObjArray objectAtIndex: branchUniversalObjectId];
422423 BranchUniversalObject *branchUniversalObj = [branchUniversalObjDict objectForKey: @" branchUniversalObj" ];
423424
@@ -532,7 +533,7 @@ - (void)showShareSheet:(CDVInvokedUrlCommand*)command
532533 completion: ^(NSString *activityType, BOOL completed) {
533534
534535 int listenerCallbackId = [[command.arguments objectAtIndex: 0 ] intValue ];
535-
536+
536537 if (completed) {
537538 NSLog (@" Share link complete" );
538539 [branchUniversalObj getShortUrlWithLinkProperties: linkProperties andCallback: ^(NSString *url, NSError *error) {
@@ -542,7 +543,7 @@ - (void)showShareSheet:(CDVInvokedUrlCommand*)command
542543 }
543544 }];
544545 }
545-
546+
546547 CDVPluginResult *shareDialogDismissed = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK];
547548
548549 NSMutableDictionary *branchUniversalObjDict = [self .branchUniversalObjArray objectAtIndex: listenerCallbackId];
@@ -615,7 +616,7 @@ - (void)postUnhandledURL:(NSNotification *)notification {
615616 // We create a JSON string result, because we're unable to handle the url. We will include the url in the return string.
616617 NSError *error;
617618 NSString *urlString;
618-
619+
619620// if ([notification.object respondsToSelector:@selector(absoluteString:)]) {
620621 SEL selector = NSSelectorFromString (@" absoluteString:" );
621622 if ([notification.object respondsToSelector: selector]) {
0 commit comments