iOS silent push notification only works when connected to xcode - ios

I have an odd issue.
I recently updated my Xcode to 6.1.1 to make a change to an app I previously released with Xcode 5 (working great). Now for some reason with the new Xcode when I test my background silent push notification it only completely works when I have my iPhone connected to my Mac?
What the app does is when it gets a silent push the app retrieves data from a server. I added the default sound to the silent push for testing, and I've confirmed that the app does get the push but it does not connect to the server to get the new data. But if I plug in the lightning cable to my mac everything works great, gets data from server etc.
I'm not sure what to do? Any ideas or direction is greatly appreciated.
Thanks!

I got no problem to send silent push to my app, even if the app is not connected to Xcode BUT you have to notice that silent push notification is being delivered only if your app is running in the background. If you force quit your app using double tap on iPhone home button, the notification is ignored.
It is probably an Apple rule to let user completely kill an app and stop any outgoing/incoming connection

Related

Linphone PushKit - Not receive VoIP PushKit in TestFlight mode

I'm working on linphone iOS repository and I made some UI changes and added some new features to it for customization! Now, I wanna add VoIP PushKit capability to this project for receive incoming calls when app is in background mode or force closed by user!
I created all necessary certificates for it from the apple developer account and everything is ok in development mode ( when run the app in my iPhone by usb cable ) but when I build the app for production mode and send it to AppStore connect and release it to TestFlight, The app can not receive pushes from APNS! PushKit Token is registered and I save it in my server db successfully but when I send a VoIP push to app, is not received! I try to get log of installed app ( TestFlight mode ) and I've found out push receive to OS but the OS not awake the app and delivered the push to my app!
Please help me to fix this problem! TNX all!
If in your development environment, everything is working (meaning: you get the PushKit notification and also the corresponding SIP INVITE and CallKit is launched and you can take the call), it probably means that you haven't switched your APNS client from development to production. See e.g. under https://github.com/nomad/houston :
# conveniently use `Houston::Client.development` or `Houston::Client.production`.
APN = Houston::Client.development
APN.certificate = File.read('/path/to/apple_push_notification.pem')

Firebase iOS push notification receiving but sometimes not?

I have implemented push notification in my iOS App using Firebase SDK and I am successfully getting push notifications from Firebase console as well as from server.
But on many occasions, I wait and wait, and even send 5-6 notifications from Firebase console but not received on App. I tried to change network (both Mobile data & WiFi) but still not receiving. After waiting for an hour and more, suddenly it starts working (I am not re-installing App).
What may be the reason? If network is an issue, then why is it not woking though I change my network to WiFi having good bandwidth?

Xcode iOS application Swift 3 Stop listening when I leave application window and go out to home screen

I have an issue with my iOS app, written on Swift 3 with Xcode.
I'm using WiFi Socket server Communication in my app to communicate with a Raspberry Pi via WiFi protocol, and UserNotification in Xcode to receive these notification sent from RPi.
The problem is when I leave the application's window and go out to home screen, it seems my app stop to listening and when my RPi send the nothifications, there is no notification on my iPhone to see.
When I test my application with Xcode simulator, it works well, on applications's window or out there on home screen, but when I test it on my iPhone device, it receive the notifications only when I rest on application's window, and stop working when I push home's button to being on home screen, or any where outside of application windows.
Maybe someone Know a solution,
Thanks in advance,
Check the state your device is when you go on HomeScreen. Don't compare with simulator for notifications. You need to do more debugging.
The application is running in the foreground, iOS won't show a notification banner/alert. That's by design. You have to write some code to deal with the situation of your app receiving a notification while it is in the foreground.
Also, I dont think that it has anything to do with swift
Check this link to get better idea Notification when in foreground iOS

iOS Pushbots not working

Today I published my first app to the iOS App Store (hooray!).
When I tested the app, push notifications worked perfectly fine (using pushbots). But after downloading the app from the App Store, I did not receive any push notifications anymore.
I'm hoping someone here knows what might be the cause of this problem.

Upgraded to Cordovo 2.2.0 and now push notifications stopped working on lock screen (IOS)

I upgraded to cordova 2.2.0 and now my pushwoosh push notifications stopped working. They only work when the iphone is unlocked?
When I send out a push... nothing happens on the ios device.. until I unlock the screen (then the pushes come through).
I have verified that the notifications settings in the
iPhone's Settings - Notifications - MYAPP - "View in Lock Screen" = on...
any ideas?
That's very strage. I have tried Pushwoosh with Cordova 2.2.0 and it works fine and notification displays on the lock screen with no problem.
If the screen is locked for a while then the phone may go into the deep sleep mode (to save the battery) disabling all networking operations, and push notifications will be delivered only when then phone will be unlocked. But that's not the case if you locked the screen just a minute ago. In this case I will suggest doing clean reinstall of the app and rebooting the phone. Sometimes it helps, especially if you have been changing push notifications settings.

Resources