Hello,
I am working on a n app that sends updates to all its users, and for this I need to get push notifications working.
The googlePushNotifications example works perfectly, after that I added the code sample for registering with pushwoosh, and when I run the app in my phone and tablet logcat gets “PushWoosh registration successful + deviceID”
if event.type == "remoteRegistration" then googleRegistrationId = event.token local message = "This app has successfully registered for Google push notifications." native.showAlert("Information", message, { "OK" }) -- Print the registration event to the log. print("### --- Registration Event ---") printTable(event) -------------------------------------------- local deviceToken = event.token deviceType = 3 print( "Setting up with PushWoosh" ) local DeviceID = event.token local PW\_APPLICATION = "E006F-\*\*\*\*\*" local PW\_URL = "https://cp.pushwoosh.com/json/1.3/registerDevice" local function networkListener( event ) if ( event.isError ) then --error occurred native.showAlert( "Notification Registration Failed", "An Error Contacting the Server has Occurred.", { "OK" } ) else --registration successful! print( "PushWoosh registration successful", system.getInfo("deviceID") ) end end local commands\_json = { ["request"] = { ["application"] = PW\_APPLICATION, ["device\_id"] = DeviceID, ["language"] = "en", --OR: system.getPreference( "ui", "language" ), ["hw\_id"] = system.getInfo("deviceID"), ["timezone"] = 0, --offset in seconds ["device\_type"] = deviceType } } local post\_body = json.encode( commands\_json ) local headers = {} headers["Content-Type"] = "application/json" headers["Accept-Language"] = "en-US" local params = {} params.headers = headers params.body = post\_body network.request ( PW\_URL, "POST", networkListener, params ) ------------------------------------------ elseif ( event.type == "remote" or event.type == "local" ) then ............
The google registration works, and a while after I tap the screen I get the notification, the problem is even after the app logs “registration successful” the pushwoosh dashboard shows 0 subscribers (it should be 2 by now) and the first time I ran the app was 14 hours ago.
In pushwoosh the only configuration option for android is “API Key” and I’ve used the same I used inside the code, without quotation marks, though.
I don’t know where to look for the problem, so if anybody could offer any hint on what I might be missing I would highly appreciate it.
Thanks in advance!!