APNS not received after server migration - ios

Our iOS app successfully implemented APNS. Sometimes its not getting received but almost 90% of time its ok.
Now we are required to migrate the whole server-side (which is written in PHP) codes.
After few hours, everything was done and thought migration was completed (all webview was correctly shown, user's data etc.). However, when my colleague try to send push notification to my iOS app, it failed to receive. The server log stating that the APNS was successfully sent and no errors. Interestingly, when he try to send APNS through web browser (hit the URL to send the command), it's successfully received.
Now we don't know where to go from here and don't know what to do. Are we missing some process required in the case like this? For example, should we re-create Certification files for APNS if we want to migrate the whole system? Is there any iOS code at all to modify when the server was migrated? (Other than referral to the server URL. We have already checked that)
I know that the question is too vague but it's just happened and we really can't think of any reason. If there's any guidance for server migration for APNS, it would totally appreciated.
Thanks in advance.

You're right, way too many unknowns to give you a straight-forward answer :)
But, if I understand correctly, when you trigger the PHP from a web browser, the push works. When it's triggered via command line, it doesn't.
Make sure that the user who is executing your script via command line belongs to a group that has enough rights to execute all the statements in your PHP script. For example, if you're using the fwrite command, the user executing the script must belong to a group that has access to the file system.

Related

Youtube API - stream key issue - lives stream

We have a project where we create slots for the live stream. Project has been created on the Google cloud platform, implemented the oauth2.0 connection. It worked well at first, but we wanted to switch from testing mode to production. We have not received stream keys back since then, so we cannot use our tool. According to the dashboard the tool connects to the project. We tried to get back from production to test mode but it did not help. We started the process from the scratch, but the result is the same: no stream keys (we get back an empty string). Any advice? Maybe due to the change to the production mode, do we have to go through the verification procedure to get stream key? Thank you in advance!
Indeed, you need to get your application audited and approved by Google.
Fill in this form; then wait for their response.
Be aware that, according to the experience of users of this forum, Google's answer does not come shortly.

How to get logs from remote device

Our iOS app has a subtle bug which is 100% reproducible on one of the team members’ device.
He is not a programmer, so he does not use XCode.
To investigate the bug, I plan to make a custom build with logging, ask him to launch it and reproduce the bug.
The question is where to write logs to and how to get them from his device with minimal friction.
I believe that logs must be written to some local file on iPhone, and then he send me this file say by email.
Are there any ideas how to make this sharing clear and easy for a non-programmer?
Little clarification:
In my concrete case I need to log a couple of (rather long) base64-encoded string.
The better way for your scenario is use slack, telegram or any chat application. Then instead log to the files, you can send log to a channel directly.
https://core.telegram.org/bots/api
https://api.slack.com/messaging/webhooks
In our applications, we write the log to the files, then server side supports the api to upload these files.

iOS app submission - test url

We have built a iOS application and we are going to submit it to App store. Inside our app we have hardcoded the url of the webservice.
Our client wants to do something like this.
For the review he wants set that url to the webservice in the dev and after approval to change it to production. As he doesn't want to create fake accounts and data in the production database.
Is there any setting or something to do such a thing for the approval without changing our code.
Thanks
Hardcode a specific URL in your app. Then setup your web server so that URL gets redirected to the "real" URL. Before your app is in the store, have the URL redirect to the development URL. Once your app has been approved and it goes live, change the URL to redirect to the production URL.
This is basically a single line change in the web server's config file.
This gets a little trickier if you need to repeat the process each time you submit an update. You probably will want the review of the update to go back to the development URL. This will probably required that you pass a version number as part of the URL (which you should do anyway incase the API of your URL changes over time).
You can check whether on not the app is in AppStore. Check out this answer for more info: https://stackoverflow.com/a/17627239/2604030
I am hoping you haven't also hardcoded a password in there.
However, unless this is a very long-term, robust service, also hardcoding your database server details in there is also a bit dangerous.
Consider writing them to NSUserDefaults but having a failover service.
For example, if the server doesn't respond, have a different server you can hit to get a new database server address.
This would allow you to setup a test server, kill it after review, and have new users go to the new server.
Another approach is, if you have a way to push notifications to the devices or have a status check that they do, add extra metadata to that check message so you can pass through an update to the server address.
Querying a separate server for important metadata is a common technique - it lets you have some flexibility and respond to emergencies.
Why not just KISS and set the URL in NSUserDefaults or a plist (i.e. validation=URL1, validated=URL2 or something). This way your URL is configuration-based and not embedded in your code. You could use Sebyddd's response in your code to determine which URL you grab at runtime

Push notifications issues: key,failed/message not reach

I'm still new to iOS dev.
And I'm very, very new to whole APNS idea. I followed many tutorials, and didn't go so well.
I'd like to ask some questions.
Can I use same .certSigningRequest file for dev/dist/apns certificates? Does it matter if some of this certificates from this .certSigningRequest have been revoked?
When I export my key in keychain to .p12 file, can I use this one for both dev/distribute version?
If my server open port 2195, by giving .pem generated from above cer, my server should be able to send push message, right?
How can I unsubscribe/unregister from my device and/or from server/apns service? I mean when I need to remove, and try to build&run the code again.
4.1 How does
[[UIApplication sharedApplication] unregisterForRemoteNotifications];
really work? Does it tell apns not to send message/just turn it off? How can my server/provider know if device need to unsubscribe?
I find this tutorial really useful: http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
And here some questions I have about what I encountered.
1. The sample app from the tutorial worked fine, using both my laptop & my server to send a message. But after a few days, it doesn't. (the response is still 'Connected to APNS Message successfully delivered', but the message never reach my device)
What could be the cause? My friend have revoked a dev cert? (I shared acc. w/ my friends) Or I reinstall the app? I also tried method unregisterForRemoteNotifications & register again, but nothing happens.
2. I also tried https://apphq.shephertz.com for a provider. This one requires .p12 key file in their format. (link) I have another project (this one is unity) register apns thru the app. It seems fine since I can see device token & user store in the web. But when I tried to send message, I got an error, like
iOS KeystoreException Device ID : <my-device-token> : Invalid keystore password! Verify settings for connecting to Apple... Does anyone know what this mean?
Sorry for my poor English.

webtends - How to test its working

I have been given a webtrends DCSID number that is liked with my clients webtrends account.
However I have not been given access to the clients account, so I have no way of verifying if the reporting is working.
Is there a way to verify if it is working, e.g. setting up a trial account to test on?
The target is an iPhone app
You can also download an HTTP monitoring tool that will show you everything that is sent to Webtrends when the tag fires. It won't show you what the reports will look like, but testing the tag should really be the first step in any tagging implementation. If the tagging doesn't work as expected, the reports won't work either. :)
Standalone tools: Fiddler (free) or HttpWatch (basic or paid). Firefox Add-on: HTTPfox (free).
To test how the tag fires from an iPhone, you will need to either use a User Agent switcher/spoofer in your desktop browser, or use an actual iPhone and monitor the traffic using Fiddler—here are instructions. Once you install one of these, look for the hits to http(s)://statse.webtrendslive.com/[the client's DCSID]/dcs.gif?etcetera
You can go to https://tagbuilder.webtrends.com and generate the needed files for tracking, e.g. an empty html page and the javascript. If possible, upload both to a test webspace and access the page. Type into the addressbar
javascript:dcsDebug();
and a small popup will appear. You will now see all informations collected by the javascript and what would be send to the SDC server.
If needed, ask your customer to send you the logfiles of the SDC and compare the logs with your activity.

Resources