Closed Vahn84 closed 9 years ago
i've managed to import it correctly installing dependencies with cocoapods. Now it gives this error
Undefined symbols for architecture armv7: "_kGGLInstanceIDScopeGCM", referenced from: -[GCMPushPlugin didRegisterForRemoteNotifications:] in GCMPushPlugin.o -[GCMPushPlugin onTokenRefresh] in GCMPushPlugin.o "_kGGLInstanceIDRegisterAPNSOption", referenced from: -[GCMPushPlugin didRegisterForRemoteNotifications:] in GCMPushPlugin.o "_kGGLInstanceIDAPNSServerTypeSandboxOption", referenced from: -[GCMPushPlugin didRegisterForRemoteNotifications:] in GCMPushPlugin.o "_OBJCCLASS$_GGLInstanceIDConfig", referenced from: objc-class-ref in GCMPushPlugin.o "_OBJCCLASS$_GGLInstanceID", referenced from: objc-class-ref in GCMPushPlugin.o "_OBJCCLASS$_GCMConfig", referenced from: objc-class-ref in GCMPushPlugin.o "_OBJCCLASS$_GCMService", referenced from: objc-class-ref in GCMPushPlugin.o "_OBJCCLASS$_GGLContext", referenced from: objc-class-ref in GCMPushPlugin.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)
i had to set the "other linker flags" to $(inherited)
Please @Vahn84 I have the same error, could you explain with more details please?, sorry but I'm not a advance iOS developer, only with Cordova. Thanks in advance :)
In the build settings of the Xcode project you'll find a voice named "other linker flags". Inside the right column of that voice you have to put that command
also make sure you add this $(inherited) only to target. not to the project's other linker flags.
when I paste $(inherited) there is replaced by "-weak_framework CoreFoundation -weak....." but when I select again to edit, is again $(inherited). Is correct this behavior? but the error continue :(
you have to add , not replace the other links flags, Post a pic if you can here.
This is what I'm doing:
and this is the error:
try -$(inherited).
When I try:
Could you list the steps one by one please?. Once having all certificates and the Google.plist file what I do is: Don't install the plugin via "cordova plugin add" because this produces the error "Missing Goolge/CloudMessaging.h" so, I install vía cocoapods adding "pod Google/CloudMessaging" to the pod file that is when I have this error. Many many thanks in advance.
Hello colleagues, I finally set everything correctly, added $(inherited) before the installation with Pod and ready, now my problem is the same of many of yours :( #4 Anyone could make it work?
I am afraid that its still an issue. If you are able to solve this issue(#4) then do share the solution/workaround.
Wich version of iOS are you tried?
9, 8 and 7 as well. issues are same as mentioned in #4
Hello colleagues, have not yet been able to run the notifications :( I'm getting the following error in the console: "enabledRemoteNotificationTypes is not supported in iOS 8.0 and later". Please help me, I'm going crazy
This may help: I had similar problem, and it's fixed by using content_available and priority options as shown in below documentation:
You should send "content_available":true, and "priority":"high",
https://developers.google.com/cloud-messaging/http-server-ref
enter image description here
Sample JSON request:
{ "content_available":true, "to":"fd4...23f7", "priority":"high", "notification": { "body":"anything", "title":"any title" } }
Hello guys,
I'm having the same problem as conmiguel. I added -$(inherited) and get the unsupported option '--weak_framework" error. How did you fix that @comiguel?
tryout this version instead, it's working with me with minor changes https://github.com/malah-code/GCMPushPlugin
What change u did?
version and configurations changes, check the code diff for details https://github.com/gonzaloaune/GCMPushPlugin/compare/master...malah-code:master
Any changes for ios
You should follow the Google GCM documentation for setup ios project before this plugin could work
I got alert for "Would like to send notification" but not getting the Registration key .....please advice
If i missing any thing. FYI - register method only called.... initWithWebView,didRegisterForRemoteNotifications,didReceiveRemoteNotification are not called...
I got registration id....but i click the notification onNotification function not called malah -code please advice...
Hey, I had the plugin working, it stopped after updating cordova to latest ios version (I think, not sure if that's exactly what happened because at first I didn't notice that push stopped working)
I've noticed that the function that's not working is: "didRegisterForRemoteNotifications" in GCMPushPlugin.m, up to that point everything works.
I am not sure what is wrong, last idea I have is:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRegisterForRemoteNotifications:) name:CDVRemoteNotification object:nil];
that this observer is not working, but I don't understand why
Can someone help?
How I know that the plugin is broken at that point, is that I added NSLog to AppDelegate+Notification.m
- (void) application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
NSLog(@"Token: %@", deviceToken);
...and I do see the deviceToken in xcode console.
2016-04-13 13:19:56.923 theApp[353:45275] Token: <313b3f3b 79210870 2f4c070c 3c1e3b5f 34f9a749 848e29ba 626c5dea e0af15b3>
back at GCMPushPlugin.m, this function is never fired:
- (void) didRegisterForRemoteNotifications:(NSNotification*)notification {
NSLog(@"did register and should be passed");
My javscript function looks like this:
successHandler = function(result) {
console.log('success handler')
console.log(result)
var device_token = result.gcm;
device = window.device
var deviceRegistrationData = {
token: device_token,
os: device.platform.toLowerCase(),
description: device.model
}
devicesService.save(deviceRegistrationData, function(response) {
$window.localStorage['dt'] = response.data.deviceId
window.location.hash = 'account'
});
}
errorHandler = function(error) {
console.log('notification registration error')
}
GcmPushPlugin.register(successHandler, errorHandler, {
"badge": "true",
"sound": "true",
"alert": "true",
"usesGCM": true,
"sandbox": false,
"jsCallback": "onNotification"
});
And to help you a bit with missing header, just add this line in "Classes/AppDelegate.m"
#import <Google/CloudMessaging.h>
Building the app for ios generates this error...
Thanks