iOS App to Ping Users Like Find My iphone "Play a Sound" - ios

I have an idea for an app and have the design created but unsure how to go about doing it programatically. The idea is simple... ping a silent phone the way "Find My Phone" can make a silent phone make a sound. The idea is to have the app read an incoming text message with a command embedded in the text from an "authorized" user.
Example: #URGENT from my wife would make my phone sound even if it was on silent but #URGENT from my friend would not cause any action because he is not "Authorized" in my app.
From what I have found online, reading text messages in iOS is prohibited unless you build your own API/SKD (BMW reads the text from the notification center for their iDrive function) which will then get rejected by the app store. Is this correct or is there a way to do this?
My questions:
Can an app trigger an event by reading text messages with embedded commands like on Android?
In iOS is there any way to make a silent phone create a sound at full volume?
I've found that this is possible for Android, but I want to see if it is possible for iOS.

Unfortunately, the answer is no.
In order:
An iOS app has no access to the text messages of the user at all, so there's no way to trigger anything that way.
Not as a notification sound, but it's possible that by using a background audio session you could play a sound on a phone that is silenced, but still has the media volume up. However, Apple might not like this (you'd be using media playback APIs for alert noises, Apple doesn't want anyone circumventing the users decision to silence the phone).

Related

Mute IPhone prorammatically is legal?

I gonna start working on an app that have basic functionality to mute phone(no sound from any app, ring tone).
I searched over net and found some private api's to do what I want.
Mute iPhone programatically
https://github.com/forensix/BBSettings
But found some articles saying that Apple will not approve such kind of apps. And when I searched over store I got an app link below
https://itunes.apple.com/us/app/autosilent/id474777148?mt=8
This is auto silent app, that put iphone to mute state.
So now I want all my seniors to let me know whether I can do this app or not?
The application that you mentioned has the purpose of muting the phone. Someone downloading it expects it to mute the phone. That's probably why it was accepted on the store.
If your app mutes the phone, and the user didn't expect it, they could very likely miss important phone calls unexpectedly, which could be very damaging. So you would need a very, very good reason to have that functionality in your code.

Pedometer in the Background

I know this has been asked 1 million times but it has been just impossible to figure it out for me.
So I need to build a pedometer app and have it continuing counting steps event if they send the app to de background for more than 10 minutes.
The client wants not use use GPS at all, an also not play a silent audio because Apple may reject it.
Does anyone one have and idea on how to do this?
The client is taking Runtastic Pedometer app as Reference and I have been analysing it and it doesn't use nor Location, nor music and runs in the background for more than 10 minutes.
Any clue? is it really imposible to do it this way? could be possible that Runtastic people made an agree with apple to use some secret API to have it running in the background?
I looked at Runtastic Pedometer and it has the following in its Info.plist file:
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>external-accessory</string>
</array>
So basically, they do the audio trick, and they claim some tie-in with an external accessory.
I hate to state the obvious, but your question appears to be "These are the rules, but I don't want to follow them. How do I get around them?" The answer appears to be: "Add features to your app until you meet one of the criteria." From the docs:
In iOS, only specific app types are allowed to run in the background:
Apps that play audible content to the user while in the background,
such as a music player app
Apps that keep users informed of their
location at all times, such as a navigation app
Apps that support
Voice over Internet Protocol (VoIP)
Newsstand apps that need to download and process new content
Apps that receive regular updates from external accessories
So add one of those features to your app. Add a setting to play a congratulatory noise after every mile walked. Leave it off by default. That should qualify you for the audio-playing exemption. Have an option to capture location data to mark where the user was when they crossed 1,000 miles walked. Leave the feature off by default. That should qualify for the location criteria. Add a feature to download inspirational Haiku from an RSS feed, or headlines from runnersworld.com. That might get you in on the new-content reason. It's not hard. Just come up with some trivial, ten-lines-of-code feature that gets you in the door. Use your imagination.
You can check the Apple docs about Declaring Your App’s Supported Background Tasks. You can also check this tutorial about using the background modes.
If you have a server side you can avoid running your app in the background by itself, by sending a silent push and waking up your app just for reporting the steps count.
You can register for silent pushes without having the user to confirm getting push messages since they don't see them.

is it possible to send push notification with video/audio IOS?

I am working on an application which uses apple push-notification. I implemented this feature and working fine, now client is asking about sending push-notification with Audio/video file.
Can you please tell me whether apple allows this type of notifications, if YES any suggestion to implement.
Thanks.
Well yes and no is the answer. You can't really include the audio/video in the push notification.
What you could do is, in the payload of the push notification, add an URL to an audio/video file. Once your user select to view the push notification you can pick up the URL and load the audio/video.
I was searching for this and found this thread. I would like to update it by saying that with iOs 10+ now images, video and audio are now supported with little limitations which are:
Devices WITH force touch support video, images and audio.
Devices WITHOUT force touch only support images.
(not sure if audio is supported too, but videos definitely are not supported)
take a look at https://developer.apple.com/documentation/usernotifications/unnotificationattachment
push notification is simply a message, and it has a very limited length (256 characters, including service, or more). It can add a number on the icon, or play sound by it name (sound should be in the folder of application) and actually show a message. You can pass additional data - number, link or resourceId, but the resources need to pass in other ways

Send audio to bluetooth device with AVPlayer IOS

Hey I have a video app which uses AVPlayer, I received an email from a user saying he couldn't use his car's bluetooth anymore since I updated the app some time ago.
Now, I didn't tried to support bluetooth back then, but apparently this functionality came along with MPMoviePlayerController which I used before.
Is there a way to check if there's a bluetooth device connected and to send audio to it?
I've seen this question, but it didn't help, the volume control shows but no button letting me chose the output.
Do I have to do something else in order to use bluetooth as output?
I've only tested with my car's bluetooth, which works with phone calls and also other apps like Viber.

iOS: read sms while app is active, like Drivesafe.ly does

Can you point me to a method which allow an app read sms messages while the app is active.
I know many people say it's not possible, but Drivesafe.ly does it and I know some bank apps do that. The only condition for that to work is that the app is currently active (shown on the screen).
Many thanks!
Iam afraid its still not possible on iPhone. If you check the iTunes page for Drivesafe.ly app, there is a notice about that.
It says:
...the application does not read native text messages out loud that come directly from your wireless carrier. Unfortunately, this is not technically possible on iOS devices today...

Resources