avivais / phonegap-parse-plugin

Phonegap 3.0.0 plugin for Parse.com push service
195 stars 315 forks source link

Update CDVParsePlugin.m #56

Open ihsanberahim opened 9 years ago

ihsanberahim commented 9 years ago

Example of the way to hack.

    // Call existing method
    // [self swizzled_application:application didReceiveRemoteNotification:userInfo];
    //[PFPush handlePush:userInfo];

    NSString *message = userInfo[@"aps"][@"alert"];
    NSString *eventName = @"didReceiveRemoteNotification";

    [self.viewController.webView stringByEvaluatingJavaScriptFromString:
        [NSString stringWithFormat:@"setTimeout( function() { cordova.fireDocumentEvent('%@', {message:'%@'} ) }, 0);", eventName, message]];

    NSLog(@"%@ : %@", eventName, message);
aaronksaunders commented 9 years ago

what problem is this trying to address? Just curious as I am considering integrating this plugin into an application