Page 1 of 1

Push Notifications with Parse,com

Posted: Wed Oct 17, 2012 9:05 pm
by Eric5020946

Since I don;t know XCode and project structure very well I could use some help. I exported xcodeproj form tiggzi and imported into XCCode 4.5.x

Below instructions from parse,com on code implementation, 2 simple snippets to add.

1) ==from parse==
Open up your AppDelegate.m file and add the following import to the top of the file:
#import
Then paste the following inside the application:didFinishLaunchingWithOptions: function:
[Parse setApplicationId:@"personalkeyidapp"
clientKey:@"personalclientkeyhere"];
=============

QUESTION: does it go into phonegaptemplate.m file?

2) ==from parse - testing procedure==
Add the following code to your main app delegate class and inspect the error given:

  • (void)application:(UIApplication *)application
    didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
    {
    if ([error code] == 3010) {
    NSLog(@"Push notifications don't work in the simulator!");
    } else {
    NSLog(@"didFailToRegisterForRemoteNotificationsWithError: %@", error);
    }
    }

    QUESTION: I can't locate this method, where do I find it?


Push Notifications with Parse,com

Posted: Thu Oct 18, 2012 2:00 am
by maxkatz

I'm guessing it's better if you ask Parse as it's their tutorial.


Push Notifications with Parse,com

Posted: Thu Oct 18, 2012 12:45 pm
by Eric5020946

I did but looks like epxorted by tiggzi xcode is very specific structure-wise due to included cordova project and naming convention


Push Notifications with Parse,com

Posted: Thu Oct 18, 2012 2:25 pm
by Agon Bina

Max, a tutorial showing us how to use the push notifications from Parse in our Tiggzi app would be very helpful, when you get a chance to make it :)


Push Notifications with Parse,com

Posted: Thu Oct 18, 2012 3:12 pm
by egonzalez

That would be incredibly helpful. It's a feature I will definitely need to use as well. An extremely basic implementation of it would suffice!


Push Notifications with Parse,com

Posted: Thu Oct 18, 2012 3:15 pm
by Eric5020946

Max, just so you know parse.com has very clear instructions but it gets tricky when code should be added to specific function or file - names they use are different than in tiggzi xcode

BTW the moment when you have your push notification service running I'll be the first one to switch back to tiggzi :)


Push Notifications with Parse,com

Posted: Thu Oct 18, 2012 4:38 pm
by maxkatz

We are already working on Push.. it will be out soon. We are also planning builder-push integration so it's going to be awesome and super easy!

As for Parse -- just need to find time :)


Push Notifications with Parse,com

Posted: Thu Oct 18, 2012 4:44 pm
by egonzalez

Thanks Max! I'll also be happy to start using Tiggzi DB


Push Notifications with Parse,com

Posted: Thu Oct 18, 2012 7:09 pm
by Eric5020946

UPDATE:

I managed to enable push notifications via parse.com, here are some tips:

  • add code from this docs first https://parse.com/docs/ios_guide#push

  • add code from you Quick Start docs when logged in to your account

  • comment #import "PushNotification.h" in phonegaptemplateappdelegate.m - this comes from phonegap and overwrites parse implementation, looks like tiggzi doesn't support push notification plugin but it's atatched to the project anyway

  • comment any push notification code that shows up as error when building

  • follow Quick Start steps and compile

  • run with developer profile on your iphone or with distribution profile via adhoc

    if run into missing libCordova.a file when compiling in XCode 4.5.1, open cordova project seperatly, change build to 4.3, remove armv6 architecture form both project and target and build, go back to phonegaptemplateapp and build, it should fix missing file