The iOS app i developed uses APNS. Locally i could simulate the whole process from saving device tokens, sending push notifications to deleting device tokens with help from APNS feedback successfully. Also in production it worked for a short time.
Now my webhoster closed port 2196. Port 2195 is available, so sending notifications is still possible. I do not want my ios app to get on the blacklist, so is there any other way to register whether a user has deleted my app on their device? Or will i have to look around for another webhoster, who has both ports open? Any suggestions?
You'll have to look for another host or look into 3rd party solutions that have a Feedback API. I know Urban Airship had one (haven't used it in a while) and may be giving access to it freely.
Related
I'm trying to add notifications to a private chat app that uses Firebase, unfortunately Firebase has an APN service but it must be configured and needs also a server app to manage it. I'd like to have the user notified when someone is texting him while the app is in the background. The problem is that APN (Apple Push Notifications) requires a server with a certificate and that is ok with me, but I'm looking for a way to send push notifications from an iOS device to another device, I mean device-to-device push notifications and the server has just to relay the messages as they are. In my case the APN server should only relay the messages that it receives from a source device to the destination device. I couldn't find a way to obtain that without writing sever code. I want to use pre-built existing services. Has anybody any idea on how to send push notifications from one device to another without configuring and writing server apps? I tried a workaround using the background fetch iOS feature, but the system si randomly giving my app execution time... and that means that my app could wait hours before being started by the system... so that is not a viable solution. Please help
Ok, probably what I found out could be helpful for others. Actually
what I'm looking for can be directly integrated in the app. You need a library like NWPusher (free on GitHub) which can be imported, and with just a few lines of code and the APN device token you get from the system, it is possibile to implement APN notifications... easily, but most importantly... for free.
UPDATE
Check also APNS framework on GitHub. It's written in Swift 3.0 and it supports the latest features.
You are essentially looking for a messaging / chat API to handle device-to-device communication. You might want to try Pusher or PubNub
I have an app-server process that needs to check if the device making a request is an actual iOS device. I used to do this by taking advantage of push notifications. The user first authorizes push. Each time the user makes a specific type of request, I push a code to that device with which the app uses to make a second "authenticated" request to the app server. That additional channel of going through APNS would, in a sense, prove the authenticity of the requester's device. This makes it difficult for a person to spoof the request because they would not be able to receive the push notification with the needed code.
Recently though Apple started enforcing the rule that apps cannot require the user to accept push notifications in order to use the app, even though we do not use push notifications for alerts.
Is there any comparable way for my app server to check with Apple that a request is coming from my app on an actual iOS device? Or is this an unrealistic expectation to be able to determine this.
I could not find the article now, but some guys managed to register raspberry pi as a iOS device and receive push notifications via wifi... that I believe would be concrete proof that not even your first "2 way authentication" is really safe...
Now, directly answering, NO, there's no way for your app server to check if the request did come from a iOS device because all info in a TCP/UDP package is 100% "spoofable"...
I know this question can sound a bit strange, but I want to ask this anyway (feel free to downvote): is it possible to send push notifications to an iOS device without connecting to an Apple server? My idea is to send a push from my private server, not Apple's. Is this possible?
Info from developer.apple.com
Remote notifications—also known as push notifications—arrive from
outside a device or a Mac. They originate on a remote server—the app’s
provider—and are pushed to apps on devices (via the Apple Push
Notification service) when there are messages to see or data to
download.
There is no way to do it without using Apple Push Notification System (apns).
Well, the general answer would be - no.
It is not possible due to Apple's restrictions.
There may be different providers to an APN, but as the documentation suggests, there has to be a direct connection to an APN.
For more informations, please check out Apple's Documentation on Apple Push Notification Service.
However, I found this post where a user suggests using a service called Urban Airship - I have not tried this myself, so I don't know if and how it would work, but you may check it out :)
I need to implement an iOS app, which needs to receive notifications from the server. The problem is this will run in a LAN without internet connection. So I don't think I'll be able to use Apple push notifications.
And also I don't think I can run a background process to listen to the server continuously (as I understood apple doesn't allow that).
So what is the best way to implement this?
If this is for private usage, because this wouldn't be allowed on the app store, you can run a silent audio track to keep the app alive in the background. Then you can check in with the server and display notification to the user (as local notifications, not push notifications).
For you future / wider distribution, you probably don't want to go with the public app store. Take a look at the B2B options available.
since ios 7 you can use background tasks for downloading and network connections. its now official supported from apple. check out this tutorials:
NSURLSession Tutorial
iOS 7 SDK: Background Transfer Service
Is there anything preventing SENDING a push notification FROM an iOS application? There are reasons for my madness. If so, are there any good examples out there? I have code that should be working and if there is no blocking reason, I will post the code.
I tried on Verizon and AT&T. Would want it over a carrier for now.
Please do not comment on why, etc.
[addition]
This would not be for a public app, testing internal only.
I don't see any reason what this wouldn't work. You'll have to include the push certificate with your application, and your users will have to download a new version of your app every time the certificate expires (which means once a year). You'll also need to send to each device all the device tokens of devices it should send notifications to.
The sending code should be the same as it would be in a server that sends push notifications, but you would have to implement it in objective C.
All in all it doesn't seem like a good idea, since you'll need a server anyway (for each device to get the device tokens of other devices), so it makes more sense that the server will do the sending.
Actually yes - there are a few things that prevent you from sending push notification from iOS.
Even if you manage to install (use in your app) certificates needed to properly connect to Apple's APNS server their policy is to start blocking clients that create many short connections.
So for public app you would need to use a "normal" way of setting up your PHP server that manages communication with APNS. Otherwise many public IP's (devices) using your credentials would lead to blocking your app APNS certificate.
If this would be just for private use then there is no reason not to give it a try.