Hello,

I'm trying to run the official sample app, without any code changes, besides a different google project id and pushwoosh app id, but it fails at a critical step when trying to require the pushwoosh pushNotification class.

https://github.com/Pushwoosh/phonegap-3-sample-app

I am running the Android version of the official sample app, building and serving with the phonegap cli, and using the Phonegap Developer App to test it out.

I've added alerts to walkthrough the javascript and see where it fails, and it appears this line is failing:

var pushNotification = cordova.require("com.pushwoosh.plugins.pushwoosh.PushNotification");

Am I missing something, or is this sample app out of date? It looks like it was last updated for PhoneGap on Android about 4 months ago.

asked 04 Nov '15, 03:06
jguimond's gravatar image

jguimond
112

I have same problem as yours, but I'm using Cordova (latest version). Tried to integrate push notifications in my app for few hours without any success. Then I downloaded sample from github, also changed nothing (only inserted my google project id and pushwoosh app id), build it and started. And guess what? Nothing! "Subscribers: 0" in my pushwoosh account.

permanent link
answered 04 Nov '15, 17:11
rubens314's gravatar image

rubens314
112

I've had some success here.. However, it does not appear that you can use the PhoneGap Developer App to register/subscribe/receive pushwoosh notifications. I ended up building the android app (via the cordova cli) and uploading the files to Phonegap Build, then using the QR code installer onto an Android. Then when I opened my app, I did see that I had an android device subscribed to pushwoosh, and the android device alerted me with what I assume is the token. So it might be a deal where you have to develop generally with the Phonegap Developer App, but for testing notifications, you may have to actually build and install to a real device/app.

permanent link
answered 04 Nov '15, 18:06
jguimond's gravatar image

jguimond
112

"So it might be a deal where you have to develop generally with the Phonegap Developer App, but for testing notifications, you may have to actually build and install to a real device/app."

I don't think so. There is a site appsgeyser.com that allows you to create an app from any web content and they also allow you to send 3 free push notifications to your app. When I tested an app created with them on bluestacks emulator I received pushes without problems. So the emulator shouldn't be a problem here.

How did you succeed in integrating pushwoosh notifications? Have you changed something in sample from github, or used another version of cordova/phonegap/another android version?

permanent link
answered 05 Nov '15, 04:33
rubens314's gravatar image

rubens314
112

edited 05 Nov '15, 04:35

My exact steps for getting the sample app working:

1) git clone the repo 2) change the google project id and pushwoosh app id in the code 3) go to console and navigate to app (/phonegap-3-sample-app) 3) $ cordova platform add android 4) $ cordova build android 5) compress the files within that folder (now have one Archive.zip file in there) 6) upload to build.phonegap.com 7) download android app to device 8) success - alert(token) displays device token id and within pushwoosh dashboard, I see 1 subscriber for my app

My exact steps for attempting this with the PhoneGap Developer App (which does not succeed): 1..4) the same as above 5) $ phonegap serve 6) open PhoneGap Developer app on device, enter correct IP and Port for local machine running the phonegap app 7) no dice, no alert, no subscribers

I don't think that another company's emulator is a good indicator since the PhoneGap Developer is running on different technology, and it not really an emulator in the first place.

Good luck! (At this point, I'm just going to continue forward with method #1 when testing pushwoosh notifications.)

permanent link
answered 05 Nov '15, 17:42
jguimond's gravatar image

jguimond
112

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×446
×445
×165

question asked: 04 Nov '15, 03:06

question was seen: 1,354 times

last updated: 05 Nov '15, 17:42