Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android platform? #1

Open
pvos opened this issue Nov 11, 2014 · 9 comments
Open

Android platform? #1

pvos opened this issue Nov 11, 2014 · 9 comments

Comments

@pvos
Copy link

pvos commented Nov 11, 2014

Great Example, does this also support Android?

@hollyschinsky
Copy link
Owner

Working on it, should be done by end of week :)

@thinkoverit
Copy link

HI We are using this example for android, During registration request is being sent we get success to, But for some reason pushNotificationReceived event is not getting fired.
Also getting following log -

W/ActivityManager(384): Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gsf (has extras) } U=0: not found

Can you help me in this issue ?

@guizero
Copy link

guizero commented Feb 20, 2015

I really don't know what to do. +1? When I click REGISTER it says "registered for push notifications", but nothing happens, no device token is shown.

@hollyschinsky
Copy link
Owner

Have you checked the log to see if there are messages? You can run adb logcat from the command line (part of the android tools) in another window to see all the trace of what's happening to see the resulting messages.

@guizero
Copy link

guizero commented Feb 20, 2015

Here is the log:

I/chromium(18388): [INFO:CONSOLE(27)] "Register success OK", source: http://192.168.25.4:8100/ (27)
I/GCM (21881): GCM config loaded
I/SFPerfTracer( 304): triggers: (rate: 0:54) (58070 sw vsyncs) (0 skipped) (157:531598 vsyncs) (159:728930)
V/GCMBroadcastReceiver(18388): onReceive: com.google.android.c2dm.intent.REGISTRATION
V/GCMBroadcastReceiver(18388): GCM IntentService class: com.plugin.gcm.GCMIntentService
V/GCMBaseIntentService(18388): Acquiring wakelock
V/GCMBaseIntentService(18388): Intent service name: GCMIntentService-GCMIntentService-3
D/GCMBaseIntentService(18388): handleRegistration: registrationId = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, error = null, unregistered = null
D/GCMRegistrar(18388): resetting backoff for com.ionicframework.rockpush736254
V/GCMRegistrar(18388): Saving regId on app version 1
V/GCMIntentService(18388): onRegistered: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
V/GCMIntentService(18388): onRegistered: {"event":"registered","regid":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
V/PushPlugin(18388): sendJavascript: javascript:angular.element(document.querySelector('[ng-app]')).injector().get('$cordovaPush').onNotification({"event":"registered","regid":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"})
V/GCMBaseIntentService(18388): Releasing wakelock

I have even managed to send me push notifications, but I could not run the notificationReceived function, to save the user on pushserver.

ps: I have changed my regId to xxxxxxxxxxxxxxxxxxxx

@guizero
Copy link

guizero commented Feb 20, 2015

My steps where:
1- I have created my own app with "ionic start .."
2- I have added the android platform
3- I have added every plugin as showed.
4- I have edited the controller to add my GCM id and my local server (that was already running the pushserver).
5- I have ran the app in my device with ionic run android.

Thats is pretty much it. Thank you so much for your attention!

@guizero
Copy link

guizero commented Feb 21, 2015

Hey @hollyschinsky, I managed to make it work on android by undoing this commit:
be49d38

@guizero
Copy link

guizero commented Feb 23, 2015

Ok... had to update ng-cordova and it then worked! Thanks

@anshulklr
Copy link

@hollyschinsky can you explain me the functionality of services.js?
including this file is removing every view on my app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants