SITUATION: None of iPhone's physical buttons (except volume) are operational. Thus, can virtually only activate screen by receiving a notification.
Instead of simply getting the buttons repaired, I want to see if it can be an opportunity to learn.
PROJECT: Make a simple Pebble app in Cloud Pebble that will send an (arbitrary) basic notification to my iPhone, waking it up. That way, I can activate the screen remotely by, for example, clicking the Pebble middle 'Select' button. [SMS may do, but seems to be a long route compared to Bluetooth communication.]
Possible?
You can easily make an app that will use the Twilio API to send yourself an SMS. You could also use one of the services that sends you push notifications.
Related
I'm developing an iOS video chat application. I would like to display a notification like the FaceTime application does when someone calls me.
Currently I use push notifications that show banners, with a message and a custom sound.
Instead I want my app to show a custom screen for an incoming event like someone calling me for example. Is that possible using apple public API's ?
Please, see the FaceTime notification screen below.
Ps.: Skype also uses a different notification screen.
Thanks a lot,
Daniel
I doubt it has anything to do with push notifications, in fact Skype you are mentioning was able to do it before push notifications were available.
Instead iOS gives you some extra features if you create an app with background mode "voip" (voice over ip). This will allow the app to wake up and brought to the foreground once traffic is detected on the network sockets, and applicationWillEnterForeground: is called. And from there you can use any view controller.
If you now think «hmm, my app doesn't offer voip, but I will pretend to do so to get superior notifications» — don't try it, apple will reject any app claims to be a voip app just to get endless background time.
No, push notification dialog is a system dialog which cannot be customized. However FaceTime is Apple's application and they can customize it the way they want, not open to third party developers.
However you can take advantage of iOS 8.0 addition "UIMutableUserNotificationCategory" to customize the actions in the notification:
https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIMutableUserNotificationCategory_class/index.html
Example tutorial:
http://www.thinkandbuild.it/interactive-notifications-with-notification-actions/
I'm not sure how they did it, but Skype managed to get a customized notification when a User receives a call both while the device is locked and while in use.
http://blogs.skype.com/2014/09/22/skype-5-5-for-iphone-answer-skype-calls-in-an-instant/
EDIT: Looks like IOS8 added an Interactive Notifications API. This is likely your next question: How do I make interactive notifications in iOS 8 app?
If I have an app running, and I go to my home screen and do other things. My app is still running.. right? I know it's able to get push notifications and things like that. But is it able to run any operations in the background. For example, if I have my app running in the background is it able to detect an incoming phone call, or detect some other internal events?
The various background processing modes available to an iOS application are described in the iOS App Programming Guide
If you want to detect an incoming phone call to your app (a VoIP app) then you can use the VoIP background mode. If you want to detect an incoming mobile phone call then you cannot do this in the background.
One of our clients asked for this functionality: "Permanently display a message (or image) on the iPhone lockscreen".
Our initial ideas were:
Changing the device lockscreen image:
Couldn't find a solution for doing this. Couldn't find even a private API for it.
Playing an audio in background and display an album artwork. It has a few problems:
We cannot hide the volume and track buttons
Display a notification:
The notification will go away after the user skips the lockscreen
Any ideea how we can accomplish this request. Please note that the app is NOT intended to be distributed via AppStore. This is an internal app only. It should work on NON-Jailbreak devices through. The app will be enterprise distribuited.
Kind regards,
Artwork
If it's not intended for the app store, you could definitely use the artwork thing. Since you don't need to comply with the iOS guidelines, just warn your users that the lockscreen buttons won't work if you try using them. This link and this one should help.
Using the iOS 7 background fetch can help you manage messages display, as long as the app has already been opened once. To know if the app is opened, you can send ping to your server saving the current app state every X minutes. If the server doesn't receive an update, it will just guess that the app is not running, he'll send emails or push notifications to the user until he does so.
Issues:
If the user opens an app like Music or any other that can become a responder, it will override your message.
You can only display a message if the app is opened at least once.
Remote notifications
It could be a good option since a notification can stay on the lockscreen as long as the user or you doesn't clear the notification center (you have to set it). And you can remotely display any message without the app being launched.
Issues:
You have no way of knowing if he cleared the notification. An idea would be to send them an email if notifications have been disabled.
Users can just disable notifications.
Lockscreen image
You won't be able to change the device lockscreen image without a jailbroken device.
I'd go with the first one, if it's a client requirement it seems like a reliable one. It all depends on how much control they have on the devices.
Is it possible to wake up a background application with a non ios notification center? e.g. if I were creating a calling or messaging application is it possible to wake the application via SMS.
Nope. If you want to call app outside the device, you should use APNS. On the device you can use local notification. Sending SMS to wake up app is kinda wrong. People don't like such solutions - imagine bunch of SMS every day for different apps. Sorry.
No.
If you have background code running, you can schedule a local notification to yourself. If the user clicks "Ok" then you will come to the foreground. See here for a description and sample code.
As far as I can tell, the only ways to launch an app without user input is via a custom URL handler or via an accessory. It doesn't sound like an accessory fits your use case. Sadly you can't open URLs from the background, so you can't use this to wake yourself.
Quick question, I am working on an APNS enabled app and I just want to know if there is a way that when the app is not open (not in background) and the app receives a remote notification;
Can I open the app in the background, unbeknownst to the the user, and do do what needs to be done.
I have looked at the docs but it doesnt explicitly say that this can or cannot be done (from what I read), it says that the user has to open the app manually (either from tapping an alert or the app icon).
I think it is clear what I'm looking to do however i'll put an example aswell.
Example)
The default Mail app alerts the user of new emails with a badge icon, showing the number of new emails, aswell as a sound. The user must then tap the app icon to open the app and download the new emails.
I want to be able to have the badge and sound but open the app in the background (silently) and download the new emails, so that when the user does get around to opening the app the emails will already be there, ready to read.
Thanks for any help.
unfortunately, what you describe is not possible.
the only way you could get something like that is to build a voip app. see the relevant section in this document.
Implementing a VoIP Application
A Voice over Internet Protocol (VoIP) application allows the user to make phone calls using an Internet connection instead of the device’s cellular service. Such an application needs to maintain a persistent network connection to its associated service so that it can receive incoming calls and other relevant data. Rather than keep VoIP applications awake all the time, the system allows them to be suspended and provides facilities for monitoring their sockets for them. When incoming traffic is detected, the system wakes up the VoIP application and returns control of its sockets to it.
anyway, I doubt that your app would get into the App Store, then...