Issue with iPhone XMPPFramework / Openfire - objective-c

We have developed an app using Objective C XMPPFramework. However we notice that after a while the user goes offline. This is happening from a phone with iOS 4.x
We have made sure that Openfire has settings which allows clients to be idle and it also sends ping message to the clients. However, we are unable to understand why the user is going offline.
Please let us know if anyone has faced and resolved the same issue. Will be glad to provide more information if required.
Regards
Anup

XMPPStream has a property called keepAliveInterval. The default value is 120.0 (2 minutes) for an iPhone target. You might need to set that (e.g. in the same place where you initialize the stream).
If your server is actually sending XEP-0199 pings, you might need to use XMPPAutoPing or XMPPPing.

Related

Mobile Test Workbench - Status of the RTW server

I've been testing MTWWW for about a couple of days, and I've come to notice something.
I have to add the device to MTWW by going to a url on the device that looks like this,
protocol://hostname:+port/mobile
However, sometimes my device can't reach that address neither when I restart eclipse. When that happens I typically restart my computer and everything is fine and dandy again.
There was even one time that on that same screen that display the QRCode and URL to add a device, a notification appeared which showed something close to "RTW server could not start properly" or something like that.
This led me to believe that MTWW uses some other web server other that WL server to receive the recordings from the instrumented apps.
This also led me to believe that perhaps sometimes when the server tries to start the ports are already binded to some socket and it fails the initialization. Just speculation here.
However if there is a slight sense in what I written, is there a way to inspect the status of the RTW server, some dashboard perhaps?
Besides that, what should I do to fix when the RTW server didn't start properly? Rebooting the computer is pretty lame, there must be something more clever to do.
Oh, I've found this behavior on a mac osx box, on a windows one I haven't done so much testing.
Thanks in advance.
There is no dashboard for the server. But if yoy think that the issue come from the port, you can change it in the preferences. Please read http://www-01.ibm.com/support/docview.wss?uid=swg21678980
Hope its help

Does Titanium have method for "didReceiveRemoteNotification" of Objective-C?

I would like to receive remote push notification when the app is on the foreground. I think I can use "didReceiveRemoteNotification" in Objective-C, but how about in Titanium? I've been searching solutions but can't find anything. Does anybody help me out?
Titanium currently only supports local notifications (by default) I believe. You might want to take a look at AppCelerator as a solution.
Sorry, i was wrong last time. It's very hard to find but Titanium supports a way of interacting with PushNotifications.
Please take a look at Ti.Network.registerForPushNotifications. It provides a callback that is executed when you receive a Push Notification.
The other posted solutions below may provide a better integration for titanium so it's up to you what you want to use. But this should answer your original question.
Unfortunately Titanium only supports local notifications on iOS. If
you want to support remote notifications you can use
Urban Airship
ACS (Appcelerator Cloud Services) or
you write your own module that provides "didReceiveRemoteNotifcation" as an app event to your app
As far as i know you can only listen on local notifications by
default but you can try this method if it reacts on remote
notifications..

Push notifications not being received on distribute

I had successfully implemented push notifications for the developer certificate but cannot seem to get it work for an ad hoc test with a friend. I did the same process for creating the push notification keys/certificates except now I chose "Production Push SSL Certificate" instead of "Development Push SSL Certificate". I believe that this is correct since I could not find any tutorials around that showed how to do it for production... all of them were for development.
This quick process can be found from ray wenderlich blog here: http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12
This is my guess where things might have gone wrong because maybe there is a different way to do Production Push. I left my php code the same on my server as I had it before for Development Push (copied over the new ck.pem). Is this alright or do I need to make changes? I can post the code if someone thinks it is the code but as I said.. the php server code worked before.
Can someone please help me out? Thanks in advance!
I CANNOT ANSWER MY QUESTION BECAUSE I DO NOT HAVE ENOUGH REP. THE CORRECT ANSWER IS HERE
for my development I had:
gateway.push.apple.com:2195
but for production it needs to be:
gateway.apple.com:2195
Hope this helps someone in the future.
[Edited]
You can also try to check your token are correctly set, your devices are allowed to receive notifications.
If you have made many tests, you may also have been temporarily banned from APNS server, you mustn't make too many calls to the APNS server in a small time range.
Please also note that there may be some delays from the time you send the notification to the APNS server, and the time the APNS server sends it to your device.
LAst bu not least, make sure your devices have a correct Internet / SSL free access some proxies or firewalls may block notifications
Are you getting the devices token dynamically? Because when the app is in ad-hoc distribution it is generating a different device token for push notifications form when it is in debug (a.k.a developer) mode

Wireless Authentication Page iOS app

I'm not really sure how to word this exactly, so hopefully someone can make sense of it. I've been working on an iPad app that syncs files from a server to your iPad and lets you build presentations with the various files. The corporation I'm working with on this app has a wireless network that requires you to re-authenticate every hour. So every hour instead of getting the expected JSON api response, any HTTP request pulls down the page needed to reauth with the wireless network. I was wondering is there is a specific HTTP response code related to getting sent that page or a "best-practice" way of testing for that page as opposed to JSON.
Granted I could just test to see if the response is HTML, but that doesn't account for other redirect responses that I haven't found yet. I could just test part of the HTML to see if it matches a predetermined portion of the html, but I'm an outside contractor. I can't guarantee they won't change the markup or verbiage of the page after I've made my deliverable.
So does anyone out in the ether know a "best practices" methodology for testing if the app needs to reauth before syncing?
I noticed that on Mac OS X and maybe even iOS, when you connect to a new Wi-Fi network, it will try to contact www.apple.com. This is being done to check if the internet connectivity is available. If it's not available, the Captive Network Assistant will pop-up, showing you the authentication page, or sometimes when I'm in Starbucks, an advertisement.
Following your question, since Apple themselves is doing it this way, I think you could check for HTTP response code, look for something in the HTML markup (slightly discouraged though) or trying to connect to a known server (Reachability).
For a corporation practicing well-documented projects, I am quite sure they won't be changing things without making sure that your app, once deployed will continue to work.

iOS Provisioning Portal Link

I have basically finished developing my App and I wanted to test it on the iPhone, however I wanted to know if this was possible without paying the 99€ fee. I dont plan to release it on the App store in the end...
Thanks,
Anthony
It's not possible unless you jailbreak your device.
You could have another developer who has registered, build your app, and then send you a signed developer copy to add to your phone. You would have to share the code with this developer though. If it is a one time deal, you can send to me, and I can build it.
Otherwise, Ole is correct, it is not possible.