cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Mocny <mmo...@chromium.org>
Subject Re: Manual iOS steps for a Cordova plugin... really?
Date Tue, 15 Jul 2014 15:49:49 GMT
You can solve this problem as a plugin author using swizzling.

Here's an example where we do it with our chrome.identity plugin:
https://github.com/MobileChromeApps/mobile-chrome-apps/blob/master/chrome-cordova/plugins/chrome.identity/src/ios/ChromeIdentity.m#L50

Max here was the author so he'd know most about this approach.

One quick comment, we're not sure (aka seems unlikely) that its possible to
add properties like this, so you'll have to change to plugin to store its
data elsewhere.


On Tue, Jul 15, 2014 at 10:50 AM, Lisa Seacat DeLuca <ldeluca@us.ibm.com>
wrote:

> So I'm not an iOS developer but wanted to get some insight into this.  IBM
> has a set of cordova plugins for our Bluemix (Cloud Foundry) offering.
>
> The plugins are available in the plugins repo:
> http://plugins.cordova.io/#/package/com.ibm.mobile.cordova.ibmpush
>
> I was seeing a bunch of errors on the ios side, and when I reached out to
> the team working on bluemix ios cordova plugin they said it's not a bug, I
> need to follow a bunch of *manual steps* to get the ios plugin to work:
>
>
> https://mbaas-gettingstarted.stage1.ng.bluemix.net/hybrid#set-up-push-in-cordova-for-ios
>
> Is this really a requirement?  Is there really no way to avoid having to
> have manual steps to add pieces of code into the AppDelegate.h and
> AppDelegate.m files?  I find this hard to believe.
>
> "To use the IBMPush Cordova plug-in for iOS, configure the AppDelegate of
> the Cordova application.
> 1.        Add the following property to the AppDelegate.h file:
> *@property* (*nonatomic*, *strong*) NSData* token;
> 2.        Add the following code snippets to the AppDelegate.m file.
> Import the IBM Push cordova header file.
> *// Import the header file.*
> *#import **"CDVIBMPush.h"*
> Add the following code to the didFinishLaunchingWithOptions method to
> register your application to receive Push notifications.
> -(BOOL)application:(UIApplication*)application
> didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
> {
> *// Register to receive remote notification*
> [application registerForRemoteNotificationTypes:
> UIRemoteNotificationTypeBadge |
> UIRemoteNotificationTypeAlert |
> UIRemoteNotificationTypeSound];
> }
> ......."
>
>
> Lisa
>
>
> Lisa Seacat DeLuca
> Mobile Engineer | t: +415.787.4589 | *ldeluca@apache.org*
> <ldeluca@apache.org> | | *ldeluca@us.ibm.com* <ldeluca@us.ibm.com> |
> *lisaseacat.com* <http://www.lisaseacat.com/> | [image: follow
> @LisaSeacat on twitter] <http://www.twitter.com/LisaSeacat>| [image:
> follow Lisa Seacat DeLuca on linkedin]
> <http://www.linkedin.com/in/lisaseacat>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message