2

I'm working on implementing push notifications in my Phonegap iOS application, and a few things are a bit confusing.

First, i'm following this tutorial here: http://devgirl.org/2012/10/19/tutorial-apple-push-notifications-with-phonegap-part-1/

Her tutorials tend to be straightforward, but in one step, she mentions looking under the resources folder and accessing the "Cordova.plist" file, adding something under the Plugin Key.

As I am unable to do this step, the next step (involving modification of the AppDelegate.m file) produces multiple errors that I feel might be connected to this. I understand from reading the comments on her tutorial and doing some research that after version 2.5 or so of Cordova, there is no longer a Cordova.plist file, and it instead has been converted to the config.xml file only.

My config.xml file has this feature added:

<feature name="PushPlugin">
  <param name="ios-package" value="PushPlugin" />
</feature>

Is there some other place that I might be able to add the plugin key and value since I don't have a Cordova.plist file? I'm pretty new to Xcode and Objective-C, so any suggestions or explanations are greatly appreciated. Thank you!

Dan Doyon
  • 6,710
  • 2
  • 31
  • 40
Dan
  • 212
  • 1
  • 6
  • 12

1 Answers1

2

The tutorial you are following is some what out of date.

I would suggest using this plugin:

https://github.com/phonegap-build/PushPlugin

This plugin is very well documented and supports automatic installation via plugman. Manually installing a push notification plugin for iOS is very complicated and a nightmare to maintain if you need to scrap your project.

Take a look at the documentation and get yourself familiar with plugman before using the plugin linked above.

All that is required to install the plugin is this following command:

cordova plugin add https://github.com/phonegap-build/PushPlugin.git

You then must write a few JavaScript functions to interface with the plugin, it is all very clearly documented in the readme.MD.

njtman
  • 2,160
  • 1
  • 19
  • 32
  • thank you so much - it's such a pain trying to figure out how relevant these Cordova tutorials are, it seems like so much changes from version to version. A quick question about Plugman - Assuming I navigate to my project directory in terminal and run the above command, do I have any risk of losing html/js files already in my application's "www" folder? – Dan Jul 31 '14 at 17:34
  • 1
    No, installing a plugin through plugman will not touch the www or merges folder, only the plugins folder. – njtman Jul 31 '14 at 17:35
  • Too bad they made different register functions for each platform, instead of a single register function that determines the platform and acts accordingly. – andreszs Dec 26 '14 at 21:20