iMessage App to detect if receiver has the same app installed - iphone

I am trying to develop an iMessage app on iOS 10 devices.
Was wondering if there is anyway that i can detect if receiver has my app installed or not?
Coz i want to perform certain actions if its installed and vice versa.

Have a look to this link :
https://developer.apple.com/reference/messages/msmessage
You can read this :
iOS device with the iMessage app installed.
If the extension is not running, the system launches it using the
init(session:) presentation style. The conversation’s selectedMessage
property is set to the tapped message, and the view controller’s
willBecomeActive(with:) and didBecomeActive(with:) methods are called.
If the extension is running, the system calls the view controller’s
willSelect(:conversation:) method. It then updates the conversation’s
selectedMessage property and calls the view controller’s
didSelect(:conversation:) method.
Override willSelect(:conversation:) or didSelect(:conversation:) to
respond to the user selecting a new message.
You can also save messages to the file system and process them later.
iOS device without the iMessage app installed.
The system opens the
App Store for iMessage and prompts the user to install the iMessage
app.
So to sum up, iMessage will detect for you if the user has already the app or not. But you won't be able to custom actions for the part where the user doesn't have the app. If the user does have the app, you can do whatever you want when he taps on your iMessage.

Related

How to open an app automatically when app notification appears with Swift

I want an app that can be opened automatically or by itself when app notification appears. I've been looking for this case but I don't find any solution.
This is not possible on iOS. You can not programmatically open an app based on a notification.
What you can do is to use silent pushes (those are push notifications that are invisible to the user) to wake up your application in the background. Using this mechanism, you can do some work in your app in the background (like fetching some data so it is instantly available later on).
Depending on your use case, this might be of use to you.

How do i start a watch kit notification?

Im creating a app and i would like know how to start a notification to apple watch from apple watch and from iphone to apple watch
I thought local and remote notification could anyone help me????
Do you mean notifications to test your app? Or notifications in general? For notifications in general, I think (but I'm not 100% sure tough) that right now you can't choose where a notification appears, and that both local and remote notifications received by the containing iPhone app will be displayed by Apple Watch (and you can customise their behaviour and style).
To test notifications on Apple Watch, edit the scheme of your watch app and choose to display a notification from a .apns file.
Notification (local or remote) will be appeared on your Apple Watch device as it is paired with your iPhone, iPhone is locked and watches are on your wrist.
To handle incoming notifications on your WatchKit App you should create a Notification Interface Controller in your WatchKit App target's storyboard.
First it will be as a static interface. Also you can add the dynamic one and create a subclass of WKUserNotificationInterfaceController in WatchKit Extension. Link this subclass with the storyboard dynamic notification controller in Identity Inspector pane.
After all you should implement next methods in your subclass:
- (void)didReceiveLocalNotification:withCompletion:
- (void)didReceiveRemoteNotification:withCompletion:
Hope it helps!
in completion with x401om awnser :
you can't fire a local notification from apple watch to iPhone. in fact you can't choose to :
Senario 1 : The user have the phone non-locked, the notification (local or push) is always delivered to the iphone, and not the watch
Senario 2 : The iphone is locked and watch is on you're watch, and you have done some local or push notification (for local at an date and time) then the apple watch recieve the notification.

using guided access in iPhone 6 programmatically

Until now asper my knowledge it was not possible to restrict the app from exiting. User could press the home button and app will exit. Then came multitasking and when we press home button app would go in background, but on long press user can still close the app.
I am working on developing anti-theft kind of application and needed to lock the phone programatically, but seems that it is not possible.
Also another problem was if user exits app then there is no way it will get notifications from the web. After some research I found the we can restrict the application from being exited using GUIDED ACCESS facility provided by iPhone6.
But all the links that I found states the procedure to do it from settings menu of iPhone.
I wanted to know if there is any way to do it programmatically or at least display relevent iphone settings screen directly.
It is not possible to restrict your app from exiting or allowing it to lock the iPhone programatically.
This is FAR beyond the scope and bounds of security for your app to infect the system this way.
As for Guided Access it is a feature provided in iOS6 allowing parents to use their device with their kids and prevent accidental app exits or unintentional taps outside a certain bounds. It also has availability in a kiosk mode for small businesses using iPads as public information access points that want the iPad locked to an app or webpage. It is not a public API allowing your app to turn such blocks on. This again is for the security of the device.

Application which work in background only iPhone

I have requirement for an application which work in background only.
When first time application install on device then after installation that will be go to background. And after two minutes a view will popup on screen.
Now problem is that after installation how to redirect application into background?
i get answer for this that if we want to send our app into background then we have to open another app like as safari. so i get this solution.
Now problem is that how show a view after two minutes from background. I have to create as a demo not for app store. So if anyone have any solution then suggest me.
Thanks
It is not possible to do so in iOS. You can't send an app into the background
If you want your app to get displayed, the only way to do so is through push (from server) or local (from phone) notifications, and the user has to explicitly accept it.
Unfortunately, you can't make it open automatically.
iOS is not designed to run code in the background. There are a few exceptions, for example a music streaming app, or a GPS navigation app, but in general it cannot be done.
Instead, you should run your app on a server in the cloud, and send a push notification to the phone when you want something to happen on the phone. You may also be able to achieve this with "local notifications", depending on what you're trying to do.

Build Application to Answer Phone Call and Delegate To iPhone's Phone Application

We want to build an application that the user can interact with while taking a phone call. The idea is that the user can do voice communication using the phone application of the iPhone and at the same time use our application to type and send additional data that is relevant to the call such as an e-mail address. This is the scenario:
User get's a call on the iPhone
The user clicks a button on our app to answer the call and let the phone application on the iPhone handle the phone call in the background.
Our application continues to run in the foreground so that the user can interact with our application to type and send data such as an e-mail address that is relevant to the call.
Is there a way for our application to answer an incoming phone call and let the phone application of the iPhone handle the call in the background while our application continues to run in the foreground?
Thanks,
Prasanna
Currently, the iOS SDK does not support redirecting incoming calls from the system to a custom application. There is only support for initiating a call.
This is not possible with the iPhone SDK.
You could possibly do this if you created your own calling (for example, like Skype does) but I'd say you're barking up the wrong iTree here. It is however possible on jail-broken devices using the custom toolchain but I wouldn't want to recommend that path for development!
You have no control over the phone call process on an iPhone (this is assuming that you’re not talking about a jailbroken iPhone). When the user receives a call, the iPhone presents a window with the number and the “Answer” and “Ignore” buttons (or, if the phone is locked or asleep, the “Slide to Answer” bar). To return to your or any other application, the user must press the home button, sending the call to the background (and activating the red in-call status bar).
The closest you’ll get to this scenario is the user manually running the application while on the phone. But then, if all they’re doing is writing notes, they could just use the Notes app.