Automated Phone calls in swift - swift

I am developing an app in swift in which when a customer places a order we have to notify the vendor about the order. So is it possible to call the vendor mobile through some api with a pre recorded message. More importantly will this app be accepted by the app store.

On iOS it is not possible to use the user's phone. You would have to use an API like https://www.twilio.com.

Use pushkit with local notification to notify user about incoming call in foreground , background or terminated state.
Then there are many supporting platform to join in VoIP call.
References -
https://github.com/hasyapanchasara/PushKit_SilentPushNotification

Related

Send push notification to specific user?

I'm making an app where I want to be able to set a basic notification (title, message, fire date) and have been trying to figure out the best way to setup the notifications. I'm working with Swift 3 and Firebase 3.
I don't want to use local notifications because if the user is logged in on multiple devices I want it to push to all those devices.
Is there a way to do this with FCM where a user can set a notification to fire at a specific date and time and have it fire on all (iOS) devices logged in?
If FCM doesn't have this, is there another APK that does? I've looked at Batch briefly but I'm already using Firebase.
Thanks in advance!
If your main use case is to send a push notification to a single user for his multiple devices, I suggest you make use of Device Group Messaging on iOS. As per the docs, it is typically used for:
With device group messaging, app servers can send a single message to multiple instances of an app running on devices belonging to a group. Typically, "group" refers a set of different devices that belong to a single user.
When it comes to sending the notification on a specific date, I'm pretty sure you can set it up in the Firebase Console.
However, if you intend it to be sent from the server, you have to implement it yourself, since I think, there is no currently API available or a parameter you can set in the payload that can be modified for the message to be sent for a specific date.

Bluemix Mobile Push Notification Service, how to register by consumerId

When send push notification messages, consumerIds can be specified as target. But when register the device, I don't see where to supply the consumerId in the SDK doc.
Register iOS Devices
Register Android Devices
Can you let me know how to register with the consumerId?
Thanks,
Jen
Currently there is no way to register a consumerId / userId through the Android and iOS SDKs. This is a feature that existed prior but was removed due to security issues when dealing with the public facing REST APIs. It is my understanding that work is being done to reintroduce the functionality but I know nothing more than that.
That said it is possible to recreate the functionality through the REST API (https://mobile.ng.bluemix.net/imfpushrestapidocs/#!/devices/put_apps_applicationId_devices_deviceId)
In short what you would need to do it register the device normally through iOS or Android, then execute the REST GET devices/{deviceId} using the deviceId obtained at the time of registration. From there you could copy off the data, insert your desired consumerId and then execute PUT devices/{deviceId} using that data to update the device registration with the new consumerId.
The answer I posted here goes over that in a little more detail
How to register a userId to Bluemix Push Notifications services?
Again unfortunately it's pretty convuluted to execute at this point while we wait on the native SDKs to reacquire the functionality. In some cases it may be wiser to just create your own mapping of deviceIds to consumerIds and use deviceIds as your push parameter.
Have you check this documentation of the rest API for IBM Push Notification?
https://mobile.ng.bluemix.net/mbaas-api/?cm_mc_uid=70457747682413998998889&cm_mc_sid_50200000=1456154344#!/push/sendMessage_post_21
There's optional parameters for consummerIds and deviceIds.
There's also this more complex API documentation of IBMPushService:
https://mobile.ng.bluemix.net/mbaas-api/docs/JavaScript/IBMPushService.html?cm_mc_uid=70457747682413998998889&cm_mc_sid_50200000=1456154344

TVOS remote notification replacement

I am building a TVOS app for the new Apple TV that needs to get notifications from a server to update it's display. Remote notifications are not allowed with TVOS, and it actually displays an error when you try to register the app for remote notifications.
With this being said, are there any alternatives to what I need?
To clarify:
- The app stays running indefinitely, showing a display.
- When the user adds content to the display, I want to notify any apps that are logged in to the same user to update the display.
- I cannot use remote notifications.
Please let me know if this makes sense, and thank you in advance for your help!
What part of the registration errors out for you? Notification dialogs and banners may not really make sense on tvOS, but can you send a silent push notification? All you need to do to register for these is
[application registerForRemoteNotifications];
You do not need to display the request dialog to the user for permission for silent notifications (you do need to have the remote notifications entitlement though.)
According to Apple's documents here, they allow CloudKit. CloudKit subscriptions rely on silent push notifications that I would assume would work on tvOS (without them it would severely cripple CloudKit)
If that still does't work, then you could create your own long polling connection (essentially, you would be making your own custom push notifications). It would only be able to send messages to devices that have the app opened however.
I guess you can have the app poll a web server at a given interval to check if any updates have been made...

Push Notifications for iPhone - accepted methodolgy

I’m looking at the designing and developing a service for Push notifications, and am trying to understand the order of processing in the Apple App when it comes to Registering for Push Notifications and storage of the Token.
What I’m developing currently is a service that allows subscription to individual changes that happen to particular processing on our server.
When they happen, the phone user may receive a message of type “A”, “B”, or “C”.
The phone user has to “subscribe” to each of these types individually if they want them. Otherwise they can ignore it and not subscribe.
So User Fred, on Phone #4, starts our App, logs in, and then has the ability to turn on or off subscriptions to events that are sent as Push Notifications.
So I need to tie details from Fred’s login, to Phone #4’s device Token, with particular subscriptions.
So my particularly important questions are.
When the Phone connects to the APNS server to get its device token, is this automatic on app start? Or can this be initiated at a later step? Ie, after going through a loging screen on our app.
Can we (are we allowed to) store the device token on the phone in the App's data store?. Or, should the App be connecting to the APNS server every time the app is run?
How does the App know if it as already called the APNS server and retrieved a token, or as above, should it call the APNS server time the app is run?
Can we (are we allowed to) store the token in the App’s memory as it runs, so we can properly subscribe and unsubscribe for particular messages?
We need also to be able to list all the subscriptions that a particular user may have across all their devices so the user can remove old devices (if they change phones). Or can we rely upon data back from calls to the APNS – when we attempt to push a notification - to inform us that a device token is no longer valid?
Or is there some better way of tying this all together?
When the Phone connects to the APNS server to get its device token, is
this automatic on app start? Or can this be initiated at a later step?
Ie, after logging into our app.
After the app has started, the app gets the token by calling registerForRemoteNotificationTypes. This will prompt the user for permission, and call a callback with the device token if permission is granted.
Can we (are we allowed to) store the device token on the phone in the
Apps data store?. Or, should the App be connecting to the APNS server
every time the app is run?
You'll need to build an APN provider, which is a web server that calls apple to send the pushes. The thing to do with the token is post it to your server that uses the APN provider. The app doesn't connect to APNS, your provider does, and it does it when it has pushes to send.
Can we (are we allowed to) store the token in the App’s memory as it
runs, so we can properly subscribe and unsubscribe for particular
messages?
You can keep the token on the client, but you don't really need to. It's your web service that calls APN, so it needs to be kept aware of your users' subscription prefs.
We need also to be able to list all the subscriptions that a
particular user may have across all their devices so the user can
remove old devices (if they change phones). Or can we rely upon data
back from calls to the APNS – when we attempt to push a notification -
to inform us that a device token is no longer valid?
APN also provides a feedback service that you call in batch which returns the device tokens that are no longer valid. Not only can you use this service, but you must. Apple will get mad at apps that repeatedly send to no longer valid devices.
Or is there some better way of tying this all together?
Yes! Parse.com provides a nice wrapper on the client code, does the provider and feedback service, abstracts the idea of single devices to the idea of a "channel" which sounds like just what you need for multiple notification types A, B, C, provides a super-easy step by step setup, and loads of other useful cloud services for iOS. (I'm not affiliated, but a big fan).

push notification - background process - iPhone

I have just heard that - " push notification " is possible in iPhone
I need following details.
what is push notification ?
How it works ?
What does it requires ?
Any sample code link is available ?
Any documentation link if available ?
Some guidance/tips from "StackOverFlow Masters" about developing the above requirements.
Thanks in advance for sharing your knowledge with Stackoverflow family & me.
The sort of background processing you're looking to do is not possible with push notification.
Push notification allows you to notify the user of something. An example would be a Twitter client that sends a notification when the user receives a direct message on Twitter.
Push notification can not react to things happening on the iPhone when the app is not running. Instead, it depends on you having a server that determines when to send a notification and then sends one.
I'm not seeing any need for background processing in your application. If you store the user's initial location, the next time the app loads you can get their location and calculate the distance between the two. If you're looking for the route travelled, you're out of luck unless you make a deal with AT&T like Loopt just did.
Push notification is not really for that purpose, you should read up on push notification in apples site here http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html, its more for when theres data like a m essage for your user, you can have the user get it without having them open t he application. Now for your purpose, why cant you store the location when htey close the app, once the reopen the app you can reget a location, use the previous location and the new location to calculate the km travelled?
Although only tangentially related to this discussion, I think you might be interested in Loopt's agreement with AT&T to track user's iPhones (for a monthly fee).
Apple Push Notification service (APNs for short) is the centerpiece of the push notifications feature. It is a robust and highly efficient service for propagating information to devices such as iPhone, iPad, and iPod touch devices. Each device establishes an accredited and encrypted IP connection with the service and receives notifications over this persistent connection. If a notification for an application arrives when that application is not running, the device alerts the user that the application has data waiting for it.
Software developers (“providers”) originate the notifications in their server software. The provider connects with APNs through a persistent and secure channel while monitoring incoming data intended for their client applications. When new data for an application arrives, the provider prepares and sends a notification through the channel to APNs, which pushes the notification to the target device.
Check this link clearly explained Apple push notification services
http://mobiforge.com/developing/story/programming-apple-push-notification-services