[AC-734] Urban Airship Module stopped working
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Closed |
| Resolution | Cannot Reproduce |
| Resolution Date | 2014-08-26T04:39:19.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Appcelerator Modules |
| Labels | TCSupport, module, push, pushnotification, urbanairship |
| Reporter | Ygor Lemos |
| Assignee | Mauro Parra-Miranda |
| Created | 2014-05-26T23:35:26.000+0000 |
| Updated | 2016-03-08T07:36:59.000+0000 |
Description
It seems that UrbanAirship has deprecated old versions of their SDK (i have sent an email to their engineering asking about it).
iOS now throws URL errors (bad URL) on registration attempts using the UA Module.
I saw on the source that the module uses a very old version of the UA SDK v3.0.2 while the recent is version 4.0.0
Also as far as I have read the new one and compared to the old, they have changed a lot of stuff (including on the registration, using channels).
Is the UA Module development handled by Appcelerator (or any volunteer Titan) or is it stalled for now?
Thanks.
May 26 19:12:35 Raphael-Pedrinis-iPhone PiniOn[4894] <Warning>: [D] -[UADeviceAPIClient registerWithData:onSuccess:onFailure:forcefully:] [Line 139] Running device registration.
May 26 19:12:35 Raphael-Pedrinis-iPhone PiniOn[4894] <Warning>: [D] -[UAHTTPConnection connection:didFailWithError:] [Line 191] ERROR: connection <UAHTTPConnection: 0x16671cd0> didFailWithError: Error Domain=NSURLErrorDomain Code=-1000 "bad URL" UserInfo=0x165d8a30 {NSUnderlyingError=0x166cd460 "bad URL", NSLocalizedDescription=bad URL}
Hi, I have tested the Urban Airship module, got the device ID and register using this module. It works fine for me. TESTING ENVIRONMENT: Ti SDK 3.2.3.GA CLI version 3.3.0-rc iOS version 7.1 Mac OS X 10.9 SAMPLE CODE
Screenshot: https://www.dropbox.com/s/vw4ehhbs052o6ox/IMG_0156.PNG.jpg STEPS TO TEST 1. Create a new project 2. Update app.js file with sample code 3. Add ti.urbanairship module 4. And run on iOS device 7.1 5. Works fine EXPECTED RESULT It’s working as expected. Thanks/* * Demonstrates how to set up your UA Airmail Mailbox, * and how to receive notifications from UA */ // open a single window var window = Ti.UI.createWindow({backgroundColor: 'white', layout: 'vertical'}); var btnOpen = Ti.UI.createButton({ title: 'Open UA Inbox', width: 200, height: 40 }); btnOpen.addEventListener('click', function() { // Open default mailbox UrbanAirship.displayInbox({ animated:true }); }); window.add(btnOpen); window.add(Ti.UI.createLabel({ text: 'DeviceID:', top: 10, left: 10, textAlign: 'left', color: 'black', font: {fontSize: 18, fontStyle: 'bold'}, height: Ti.UI.SIZE || 'auto' })); var labelID = Ti.UI.createLabel({ text: '', top: 10, left: 10, right: 10, textAlign: 'left', color: 'black', height: Ti.UI.SIZE || 'auto' }); window.add(labelID); window.add(Ti.UI.createLabel({ text: 'Last Message:', top: 10, left: 10, textAlign: 'left', color: 'black', font: {fontSize: 18, fontStyle: 'bold'}, height: Ti.UI.SIZE || 'auto' })); var labelMessage = Ti.UI.createLabel({ text: '', top: 10, left: 10, right: 10, textAlign: 'left', color: 'black', height: Ti.UI.SIZE || 'auto' }); window.add(labelMessage); window.add(Ti.UI.createLabel({ text: 'Payload:', top: 10, left: 10, textAlign: 'left', color: 'black', font: {fontSize: 18, fontStyle: 'bold'}, height: Ti.UI.SIZE || 'auto' })); var labelPayload = Ti.UI.createLabel({ text: ' ', top: 10, left: 10, right: 10, textAlign: 'left', color: 'black', height: Ti.UI.SIZE || 'auto' }); window.add(labelPayload); window.open(); var UrbanAirship = require('ti.urbanairship'); Ti.API.info("module is => " + UrbanAirship); /* * Urban Airship will load the options from an AirshipConfig.plist file that * should be stored in the application bundle. You will find an example * AirshipConfig.plist file in the 'example/platform/iphone' folder of the module. */ // Set UA options UrbanAirship.tags = [ 'testingtesting', 'appcelerator', 'my-tags' ]; UrbanAirship.alias = 'testDevice'; UrbanAirship.autoBadge = true; UrbanAirship.autoResetBadge = true; function eventCallback(e) { // Pass the notification to the module UrbanAirship.handleNotification(e.data); Ti.API.info('Push message received'); Ti.API.info(' Message: ' + e.data.alert); Ti.API.info(' Payload: ' + e.data.aps); labelMessage.text = e.data.alert; labelPayload.text = JSON.stringify(e.data.aps); } function eventSuccess(e) { // *MUST* pass the received token to the module UrbanAirship.registerDevice(e.deviceToken); Ti.API.info('Received device token: ' + e.deviceToken); labelID.text = e.deviceToken; btnOpen.enabled = true; } function eventError(e) { Ti.API.info('Error:' + e.error); var alert = Ti.UI.createAlertDialog({ title: 'Error', message: e.error }); alert.show(); } Ti.Network.registerForPushNotifications({ types:[ Ti.Network.NOTIFICATION_TYPE_BADGE, Ti.Network.NOTIFICATION_TYPE_ALERT, Ti.Network.NOTIFICATION_TYPE_SOUND ], success: eventSuccess, error: eventError, callback: eventCallback });Hello [~ygbr]! Can you please take a look into the above testcase and let me know if works for you as well? Thanks!
Our team tested this, working as expected.