forked from bobeast/PushPlugin-deprecated
-
Notifications
You must be signed in to change notification settings - Fork 985
Open
Description
Is it possible to use the plugin with phongap v3.x (yet)?
I could'nt get it running, the readme.md seems not to be very helpful here.
Should I use plugman? or does the plugin need upgrading for use via the new node based cli tools? ("cordova plugin add ...")
Tested only on Android yet (phonegap 3.0 on a mac, followed manual install, using cordova-3.0.0.jar)
"adb logcat" output:
W/PluginManager(31200): THREAD WARNING: exec() call to PushPlugin.register
blocked the main thread for 30ms. Plugin should use
CordovaInterface.getThreadPool().
Cheers,
Michael
Activity
jdhiro commentedon Jul 23, 2013
I can't even install it via the 3.0 CLI tools =\
mwager commentedon Jul 23, 2013
I now got it installed using the following command:
However, the Java Plugin (PushPlugin.java) should be modified:
From
To
I found this by looking at other Phonegap 3.0 JavaPlugins like
Device.java
.I don't know if this is the best approach but now I reveive messages on real android devices.
It would be really great if the docs could be updated.
@Hiroio I somehow got around this error by adding following temporary to my android's config.xml:
Also, the plugman outputs lots of errors if files already exist. Trying delete them helped me.
jdhiro commentedon Jul 23, 2013
Yeah, it looks like the plugin.xml needs to be updated to avoid installation errors. At a bare minimum...
<config-file target="res/xml/config.xml" parent="plugins">
needs to be<config-file target="res/xml/config.xml" parent="/*">
.Docs are behind on the 3.0 plugin changes, so I'm looking at the core plugins as a reference. I'll try to pull together a pull request for plugin.xml changes.
Pragith commentedon Jul 23, 2013
This error appears on my phone:-
error: Class not found
For Android!
EDIT:
The error shown in Eclipse is:
07-23 15:26:27.720: D/PluginManager(20853): exec() call to unknown plugin: PushPlugin
I observed that the Push plugin doesn't get copied to the \platforms\android\assets\www\plugins unlike other core plugins.
I tried a lot, but I'm very confused because of the directory structure having similar names.
mwager commentedon Jul 23, 2013
@Pragith Try adding the following to
res/xml/config.xml
:Pragith commentedon Jul 23, 2013
@mwager OMG!
Thanks a lot! It worked. You don't know for how long I've been working on this issue.
jdhiro commentedon Jul 23, 2013
I just submitted a pull request for Cordova and cordova-cli 3.0 issues -- issue #39.
jdhiro commentedon Jul 24, 2013
@mwager have you had any luck with iOS? I'm not getting any errors, but the tokenHandler callback never gets fired now.
Edit 1
I'm getting this in the XCode console. I haven't been able to track down the issue yet:
Edit 2
From reading the 3.0 release notes, it would appear that the old signature of:
has been removed and needs to be replaced with something like
This is going to have to wait until tomorrow...
mwager commentedon Jul 24, 2013
@Hiroio I didn't try with iOS and pg 3.0 yet since I'm focussed on Android only right now. Think I'll wait to see what's going on here...
jdhiro commentedon Jul 29, 2013
This should all be fixed in my pull request
#39
mohan5070 commentedon Sep 4, 2013
I am getting this error after excuted plugman cli and pushplugin.java:
Warning: Ignoring platform 'android-10': build.prop is missing.
Warning: Ignoring add-on 'addon-google_apis-google-14': File not found: manifest.ini
jdhiro commentedon Sep 4, 2013
@mohan5070 if I had to take a guess, it would be that the v13 support APIs are clobbering the v14 APIs that you apparently already have in your project or something. You probably have to get that sorted out in Eclipse somehow. (Sorry, I'm not going to be of much help there since I've migrated to Android Studio.)
mohan5070 commentedon Sep 5, 2013
@jdhiro Thanks. I fixed all the issues.
elsigh commentedon Oct 3, 2013
I had to change the tag in plugin.xml to a jsmodule tag in order to get the CLI prepare function to install the plugin to the proper location.
elsigh commentedon Oct 3, 2013
Also, I had to rewrite the plugin JS itself to fit to the new plugin syntax (i.e. it gets wrapped by the cordova fn and put in cordova_plugins.js)
Should I send in a pull? I think this may break backwards-compat.
every25admin commentedon Oct 17, 2013
Is the issue with tokenHandler callback never gets fired on iOS fixed? I tried latest install from phonegap CLI to download the plugin, but the tokenhandler is still not fired. and no error messages at all.
omeriko commentedon Nov 23, 2013
Guys, is it now safe to use PushPlugin on PhoneGap 3.0 and beyond on Android and iOS ?, what should i do in order to avoid issues?
mwager commentedon Mar 3, 2014
If it helps, on this app everything works with the plugin, even with ios7/cordova 3.x..
https://github.com/mwager/atonego
neilsh commentedon Mar 14, 2014
I'd like to reiterate omeriko's question: Is it safe to use PushPlugin with PhoneGap 3.x, and are there any known undocumented caveats?
anyandallart commentedon Mar 20, 2014
i'm on 3.4 and it's working great for me. installed using CLI: cordova plugin add https://github.com/phonegap-build/PushPlugin.git
SteveChadaway commentedon Jun 19, 2014
I've downgraded to Phonegap 3.4 (20) and still unable to get this plugin working by any method. Everytime I get a class not found error. Anyone any joy or tips?
srameshsh commentedon Jul 21, 2014
Hi all I have the same issue.Some one can help me see the link: http://stackoverflow.com/questions/24839836/salesforce-android-app-remote-access-application-authorization
l-lawliett commentedon Oct 21, 2014
Heh guys am getting Register call but when ever i Click it i get Class not Found I manually add the Plugin and is Deploying on my phone but It says class not Fount what should i do.
look below
Push Notification
mwager commentedon Oct 22, 2014
@l-lawliett maybe you should try this:
remove the plugin from all platforms:
add it again using the
cordova add
command:l-lawliett commentedon Oct 22, 2014
Okay am Gona try that as soon as possible got my mid term coming okay
l-lawliett commentedon Oct 22, 2014
@mwager the post above
rch84 commentedon Apr 29, 2015
I am new Git. Can some one provide me steps to apply patch 39 for this plugin in cordova project?
Merge pull request phonegap-build#37 from phonegap/raghav/read
srinivasn462 commentedon Nov 18, 2015
register not defined in PushPlugin.m
(void)register:(CDVInvokedUrlCommand*)command;
{
self.callbackId = command.callbackId;
NSMutableDictionary* options = [command.arguments objectAtIndex:0];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
UIUserNotificationType UserNotificationTypes = UIUserNotificationTypeNone;
#endif
UIRemoteNotificationType notificationTypes = UIRemoteNotificationTypeNone;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
UserNotificationTypes |= UIUserNotificationTypeBadge;
#endif
}
}
else if ([badgeArg boolValue]) {
notificationTypes |= UIRemoteNotificationTypeBadge;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
UserNotificationTypes |= UIUserNotificationTypeBadge;
#endif
}
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
UserNotificationTypes |= UIUserNotificationTypeSound;
#endif
}
}
else if ([soundArg boolValue]) {
notificationTypes |= UIRemoteNotificationTypeSound;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
UserNotificationTypes |= UIUserNotificationTypeSound;
#endif
}
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
UserNotificationTypes |= UIUserNotificationTypeAlert;
#endif
}
}
else if ([alertArg boolValue]) {
notificationTypes |= UIRemoteNotificationTypeAlert;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
UserNotificationTypes |= UIUserNotificationTypeAlert;
#endif
}
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
UserNotificationTypes |= UIUserNotificationActivationModeBackground;
#endif
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
if ([[UIApplication sharedApplication]respondsToSelector:@selector(registerUserNotificationSettings:)]) {
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UserNotificationTypes categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
[[UIApplication sharedApplication] registerForRemoteNotifications];
} else {
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:notificationTypes];
}
#else
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:notificationTypes];
#endif
}
/*
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
NSString *jsStatement = [NSString stringWithFormat:@"navigator.PushPlugin.isEnabled = %d;", type != UIRemoteNotificationTypeNone];
NSLog(@"JSStatement %@",jsStatement);
}
*/