freshplanet / ANE-Push-Notification

Air Native Extension (iOS and Android) for Push Notification
Apache License 2.0
205 stars 104 forks source link

Attempting to Integrate Parse Push Notifications #20

Closed sscholle closed 11 years ago

sscholle commented 11 years ago

I am trying to integrate the Parse service (http://parse.com/) in the ANE, which involves a few lines of code and the Linking of the Parse Framework (just getting the iOS side to work for now).

Link in the Parse SDK (https://www.parse.com/downloads/ios/parse-library/latest) Code parts as follows:

#import <Parse/Parse.h>
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)newDeviceToken {
    // Store the deviceToken in the current installation and save it to Parse.
    PFInstallation *currentInstallation = [PFInstallation currentInstallation];
    [currentInstallation setDeviceTokenFromData:newDeviceToken];
    [currentInstallation saveInBackground];
}

and

- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo {
    [PFPush handlePush:userInfo];
}

I can package the the ANE via the Build script just fine.

But when I package the IAP with that ANE I get a package error:

Compilation failed while executing : ld64

sscholle commented 11 years ago

Error update:

The app is compiled using ADT with additional command line: -hideAneLibSymbols=yes

When I set this option to "no" (-hideAneLibSymbols=no) then I get the following error:

ld: framework not found Parse
Compilation failed while executing : ld64

I have the checked the platform.xml file and set (see below), to try and include the 'Parse' framework verbosely:

<platform xmlns="http://ns.adobe.com/air/extension/3.5">
    <sdkVersion>6.0</sdkVersion>
    <linkerOptions>
       <option>-ios_version_min 6.0</option>
        <option>-framework Parse</option>
    </linkerOptions>
    <packagedDependencies>
        <packagedDependency>ios/Parse.framework</packagedDependency>
    </packagedDependencies>
</platform>
sscholle commented 11 years ago

I finally got it to work, it ends up with an ANE file that 9.5MB!! But that is because the Parse SDK and Facebook SDK need to be Statically linked. I can post a tutorial for anyone interested.

Regards.

jbg-zuba commented 10 years ago

I would be interested to see that. I'm trying to do the same thing, and am running into a different issue. I've update the ANE with the Parse.Framework, and rebuilt successfully. However, when I attempt to build the ANE into the app via ADT, I get the following:

Error occurred while packaging the application:

Undefined symbols for architecture armv7:
      "_OBJC_CLASS_$_PFInstallation", referenced from:
          objc-class-ref in libcom.freshplanet.AirPushNotification.a(AirPushNotification.o)
      "_OBJC_CLASS_$_Parse", referenced from:
          objc-class-ref in libcom.freshplanet.AirPushNotification.a(AirPushNotification.o)
      "_OBJC_CLASS_$_PFPush", referenced from:
          objc-class-ref in libcom.freshplanet.AirPushNotification.a(AirPushNotification.o)
ld: symbol(s) not found for architecture armv7
Compilation failed while executing : ld64
ataugeron commented 10 years ago

It's because the .framework is not packaged with the ANE. I recommended you take a look at our ANE-Facebook project to see how we package Facebook.framework with the ANE (hint: it's in build.xml and platform.xml).

On Fri, Nov 8, 2013 at 7:34 PM, Michael Zuba notifications@github.comwrote:

I would be interested to see that. I'm trying to do the same thing, and am running into a different issue. I've update the ANE with the Parse.Framework, and rebuilt successfully. However, when I attempt to build the ANE into the app via ADT, I get the following:

Error occurred while packaging the application:

Undefined symbols for architecture armv7: "_OBJCCLASS$

PFInstallation", referenced from: objc-class-ref in libcom.freshplanet.AirPushNotification.a(AirPushNotification.o) " OBJCCLASS$

_Parse", referenced from: objc-class-ref in libcom.freshplanet.AirPushNotification.a(AirPushNotification.o) "_OBJCCLASS$_PFPush", referenced from: objc-class-ref in libcom.freshplanet.AirPushNotification.a(AirPushNotification.o) ld: symbol(s) not found for architecture armv7 Compilation failed while executing : ld64

— Reply to this email directly or view it on GitHubhttps://github.com/freshplanet/ANE-Push-Notification/issues/20#issuecomment-28109567 .

jbg-zuba commented 10 years ago

That was it. Thanks.

shvilam commented 10 years ago

@ataugeron could you please push an example I am quit sure that the my ANE include the parse framework I unzip the file and according to the size as well but still I am getting this error message when trying to pack the app with the flash builder

Error occurred while packaging the application:

Undefined symbols for architecture armv7: "_OBJCCLASS$_Parse", referenced from: objc-class-ref in libcom.freshplanet.AirPushNotification.a(AirPushNotification.o) ld: symbol(s) not found for architecture armv7 Compilation failed while executing : ld64

Thanks