Which application mode should I use in Azure Notification Hubs for Testflight betas? - azure-notificationhub

I am using Azure Notification Hubs for sending notifications.
It worked fine when I tried it a few times on my development iOS device.
But now I want to distribute the app to testers via iTunes Connect / Test Flight and the notifications have stopped working.
I am unsure as to which application mode in Azure Notification Hubs that is the correct to use with Test Flight betas? Sandbox or Production?
I have tried both without any luck.
This is for a Xamarin Forms app and I am using V4 of the Azure Mobile Client. Is there anywhere I need to disable sandbox mode in the app itself?
I am currently registering using this bit of code:
public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
{
if (deviceToken != null)
App.Client.GetPush().RegisterAsync(deviceToken);
}

So it started working "by itself" after a little while.
I chose Production for the Test Flight betas and there was no notifications coming through.
After waiting an hour or so it seemed to fix itself - now notifications are coming through just fine.
So maybe the lesson is when you change from Sandbox to Production you need to wait a bit before things work again.

Related

Sending Azure Push Notifications to Production Apps Through Azure Portal

I set up the Azure environment, with the Notifications Hub and a Mobile Backend. It works perfectly and simply with the "Test Send" feature, where I receive a notification on my phone, and can dismiss it or click on it to open the app. All I am looking for is a feature similar to this, but with production capabilities. I don't want to setup more infrastructure, and write all this code, just to send the most basic of push notifications, so I am wondering how this may be done in the Microsoft Azure portal? Thanks!
Edit 1: to anyone struggling with the same problem, Microsoft also offers a service called Visual Studio App Center, which has the extavt functionality I desired, and is super easy to implement. For some reason it was listed very highly during my searches, so I never knew it existed.
I am afraid that there is ony "Test Send" feature in Azure portal. You need to accomplish this by using code or rest api. Normally, you would send notifications using a backend server. For some cases, you might want to be able to send push notifications directly from the client application.

Sending iOS push notifications from my Machine?

I would like to add iOS push notification to my FREE iOS App
The push notification will be mainly advertising my other iOS applications. so I am expecting 1 or 2 push notifications every month
I checked service like urban airship, but I think it is expensive considering I have more than 1.5 Million active users.
So, what I am thinking of is collecting the devices token at Google App Engine ( java ), then whenever I want to send push notifications I export those tokens then send them from my Machine.
Is this is the right approach? what do you think?
Is there any framework that I could use instead of building things from scratch?
Many thanks
This approach looks ok to me. Having an app on Google App Engine to whom each of the iOS device is sending their device token. Later at any time utilizing a web page or web service running on Google App Engine APP you can push custom notification to all respective device tokens. Just keep in mind to filter the list of device tokens with obsoleted ones (in case somebody uninstall your app).
You may check http://code.google.com/p/javapns/ for APNS communication. I tried it couple of times and it worked really well.
You should also give http://www.scringo.com a try.
Among other things this framework does, it also gives you a free push notifications service to send push messages to all your users or some of them (based on your custom criteria).

Push Notifcation Woes with Titanium & XCode

I am using Titanium 2.0.2 to create an iPhone app which must, amongst other things, be able to receive push notifications. I have done the following
a. Created the AppID in my Apple Developer account
b. Configured the AppID for Push
c. Created a new provisioning profile using the newly created AppID
d. For good measure edited that profile - given that I have heard reports that the first time round it does not pick up the AppID Push info correctly
Armed with all of that I have proceeded to register my app for Push using Ti.Network.registerForPUshNotifications and coded the success, error and callback methods. I have closely followed the example in the Titanium Kitchen Sink demo.
Having done all this I had fully expected one of the following outcomes
Registration succeeds and I get the alert message I have stuck in the Success callback.
Registration fails and I get the alert message in my Error callback
Much to my surprise nothing happens at all - it is like the registerForPushNotifications call goes out into the ether and is well...gone
To be doubly sure I created a simple XCode project following the excellent tutorial at http://maniacdev.com/2011/05/tutorial-ios-push-notification-services-for-beginners/. The app registers with APNS and I trap the assigned remoteDeviceUUID using my iPad and http://itunes.apple.com/us/app/consolelog/id415116252?mt=8. I have then adapted the simplepush.php script from ManicDev and run it off my local WAMP server. It gets through to APNS and deposits my very first PUSH message. But it never arrives on my iPad!
For the sake of completeness I should mention that I am getting a development build onto my iPad with the help of TestFlightApp.
So what am I doing wrong here?
a. Why does Titanium simply not want to do anything in response to RegisterForPushNotifications?
b. Wny does my sample XCode app never get the Push notification?
I would hugely appreciate any help on this one.
A note for anyone running into this post. Beware of testing Push notifications on your iPad behind a WiFi firewall router. Most routers block access to the port used by APNS. I spent way too much time trying to find a "bug" in my code only to discover that there wasn't one. Putting the device in the DMZ on your router might help but is not reliable - at least not with my Sitecom router.
The adhoc builds that Test Flight uses are "Production" in terms of the push notifications not development ones so mostly likely your server needs to be configured with the Production APNS server keys to get it to work.

Inconsistency in receiving push notification

I found some weird behavior in push notification. My iPod app receives push notifications till last week with no issues. Then I found that my app is not receiving push notifications, and I changed the certificates and it worked fine, and after 2 days its not working. And I repeated the same process and same kinda problem. I was wondering why this happens?
NOTE I am using my own java based server to send push notification. I am sure that my certification are not expired. At the time of this problem the badge id is also not visible with my application icon.??
Thanks in advance.
Ensure a few things
You are using the correct combination of production or dev pem and the APNS or sandbox server URL
Check the Feedback services to ensure whether you are getting any errors
I faced similar issues with my 3GS running OS 4.1 last week. It started working after I restarted my device. Try doing that and see if it works.
Please make sure to update the device token in the database of you provider. I guess some updates in your iOS/certificates may changed your device token. Just make a test around that.
Try lostInTransit's solution and also check for your internet connectivity. I also faced this issue with my iPod sometimes the push notifications not come in my iPod. Try this -
Install facebook iPhone app on your device.
Send a test push notification from your server.
If the notification does not come then do something with facebook which should generate the notification.
If the notification from facebook does not come it means its related to your net connectivity.And your code is perfect.
Sometimes I see that when my iPod is on DHCP it does not receive the notification but when I assign it a static network (dedicated IP) it works fine.

Apple Push Notification Service - notification messages aren't sent to iphone device

I constructed provider code with using C# and it was able to send notification messages to iphone devices successfully. But since yesterday, it hasn't worked. Also it seems to connect APNS successfully and send notification message. Unfortunately, no notification message is received by iphone device. I controlled internet connection and device token of iphone device. What else can I do? Thanks in advance...
I dont have enough rep to comment on the question so typing out answer - Please add more details and I will edit my answer.
Is this in a developer / testing environment and are you using an ad hoc profile to install the application on the iphone devices?
Did you check if the device token has changed and that you are using the new/ correct token in the C# code?
Do provide more details of your problem.
Crazywood, I don't have a solid answer for you but I can tell you I'm in the same boat as you.
There are times when all my notifications go through and times when none of them seem to.
One guess is that not all notifications are sent. According to the docs, in production remote notifications are not guaranteed to be received by the client. My guess is that this is also the case for the sandbox.
-------- EDIT ------
I went through the trouble shooting list (http://developer.apple.com/library/ios/#technotes/tn2010/tn2265.html) and came across this:
The device may have lost its persistent connection to the push service and can't reconnect. Try quitting the app and relaunching it to see if registration completes the next time. (On iOS 4 and later on devices that support multitasking, you will need to force quit the app from the recents list.) If the registration does not complete, iOS has been unable to re-establish the persistent connection. You can troubleshoot this as described in the previous two sections.
I restarted the app and it made no difference. Then I rebooted my phone. That seemed to do the trick.