techaffinity / freshchat-phonegap

Freshchat sdk for phonegap
7 stars 36 forks source link

Bug fix for iOS isFreshchatNotification #42

Open JOldak opened 4 years ago

JOldak commented 4 years ago

Currently if it isn't a freshchat notification, then isFreshchatNotification doesn't call the supplied callback function. The fix is to add the 'else' case below:

Please could this be added to the official code?

    if ([[Freshchat sharedInstance]isFreshchatNotification:info]) {
        NSLog(@"It is a freshchat notification");
        CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:(int)1];
        [self callbackToJavascriptWithResult:result ForCommand:command];
    } else {
        NSLog(@"It is not a freshchat notification");
        CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:(int)0];
        [self callbackToJavascriptWithResult:result ForCommand:command];
    }