Send SMS through UIAlertView - ios

I work for a roadside service and I have an app I made that will text me the user's location, that way I can find them easier. Right now I have it where you click the location button, it brings up a text message view with my number and their location in the body already set. All they have to do is send the text message. But as we all know, when something what may seem easy to us, it can be hard to do for others, especially for the elderly and technically challenged. So a lot of times I have to tell them how to do it, still easier than telling them how to share their location through Apple Maps.
So I was wondering if there was a way that I could put a UIAlertView that says "Share your location with .... through text message?". And if they hit yes or send, it will send the text for them. I know Apple won't let you send SMS without the user so you can't spam their contacts, but what if they give you permission through a UIAlertView?

Apple does not allow workarounds like this for suppressing the screen for SMS sending.
The most you can do is displaying an alert view that describes what the user should do on the message sending screen (pressing the round button in the bottom right corner etc.)

Related

iOS Push Notification with Rich Content - Can I prevent a notification from being tappable?

I have a push notification with rich content.
Can I make it in such way that it is not tappable, i.e., a single tap will not open the application. It must be dragged down to rich content or 3D touched, or deleted from the notification center by swiping.
How should I indicate to the user to drag down (3D touch) in order to reveal rich content on notification?
No, a tap on a push notification will always open the notification in the app, and as far as I know there is no way in public API to override this behavior. It does appear there is a private API to get the behavior you’re looking for, as some iOS-generated (local, not push) notifications appear to do exactly what you’re asking. If you can manage to uncover that, use at your own risk should Apple find out.
Now, as for possible solutions: I would consider implementing code on your app’s delegate to respond appropriately when the notification is opened. For example, send the user to an appropriate location in the app when the app is launched from a notification…perhaps a view controller that shows the same content that would be shown as the rich notification content. I don’t know the exact use case, but the wording implies to me that if the app launches to its main interface, it could be confusing to a user.
It’s impossible for me to tell you how exactly you wish to respond to notifications, so for more on responding appropriately when the app was launched from a push notification, see the following documentation from Apple:
Determine Why Your App Was Launched
UIApplicationDelegate.application(_:willFinishLaunchingWithOptions:)
UIApplicationDelegate.application(_:didFinishLaunchingWithOptions:)
UIApplication.LaunchOptionsKey
UIApplication.LaunchOptionsKey.remoteNotification
Hopefully from that you can find a suitable solution. But if that isn’t an option, consider directly telling the user at some point to press firmly (or tap and hold, as many devices do not support 3D Touch) to view the content. You could do this during some onboarding process or, as an absolute last resort, in the notification itself.
Before proceeding down that route, though, understand that not all users know 3D Touch and/or this rich-content functionality even exists — even fewer use it regularly — and if they become confused, they may decide to clear the notification or outright disable your app’s notifications. In general, it’s also a bad idea to “teach” your user unfamiliar ways of using their device. If a user is used to tapping on notifications, as many are, they will most likely tap on your notifications. It can be tough to break that muscle memory.

Get position of UIAlertAction?

I like to do a tutorial that ask user have to press the 'Always Allow' button in the Location Permission request.
In my opinion, use a ViewController and add a UIAlertController as a subView in it, and then add another CAShapeLayer to create a white rectangle to highlight the 'Always Allow' UIAlertAction.
My problem is that I can't locate the 'Always Allow' UIAlertAction.
I need the CGPoint of this UIAlertAction. How to get it?
Update:This is not a real permission alert, I think many people misunderstanding it. In iOS, when a permission alert popup, user sometimes choose any one without reading the message on it. Because our hardware product needs location update in background, we hope user have to choose 'Always' location option, this is why do that. We want to do a guide to teach people that a alert page will display at next step and please choose the correct one. After pressing the upper right corner button, the real permission will popup. I think it's a good way to guide user.
The Right Way To Ask Users For iOS Permissions
Any suggestions for it? Thanks.
The "Allow to use location" alert is provided by the system which displays the UI in another process.
This is bad UX.
Apple will reject your app for doing this.

Can I send a text message with Sinch without having the user okay the message visually? For example, through a gesture?

Can I send an text message with Sinch without having the user okay the message visually? For example, through a gesture?
I.E: Phone is locked, user knocks on their phone, sends a text message because of the knock to their parents saying "pick me up."
The part I need help understand is if we can have the knock send the text message.
As the comment says, the "problem" is that apple wont let you subscribe to Gesture recognizer in the background. While there is ways around this i.e looking at accelerometer data in the background I seriously doubt they would be very happy users since that would drain the battery since the app would keep the phone awake at all times and using the Accelerometer all the time
So its not really a questions if you can send SMS with Sinch in the background. Its if you can invoke code with gestures on iOS in the background. And the answer no.

How can I edit the pairing alert view

I am developing an iOS 6 app that pairs with a custom BLE device.
When the user wants to pair, an alert message appears (directly form core bluetooth I guess) and the user can either push "Pair" or "Cancel".
However the title and body of the alert message are empty showing "PAIRING_TITLE" and "PAIRING_BODY".
How can I write a specific content for these two variables? Any idea?
As you guessed, that alert view is shown by the system and cannot be customized. I suppose it is the simulator that is causing those messages to be shown instead of some meaningful text. This can never happen on an actual device. Recommendation from Apple is not to use the simulator for development of BLE stuff. It is very likely that it won't be possible in the near future anyway.

local notification style coming up as banner, instead of alert

so i'm working on my first app. i'm trying to make an alarm that does OTHER STUFF. from what i've found, I want UIlocalnotification. So I've followed a few tutorials on the subject, and I have the notification fire. However, it shows as a banner which quickly disappears. I want it to look like the alarm clock alert... or any customer alert with OK, CANCEL.
Upon further reading in this forum, someone else asked the question, and if I'm reading it correctly only the USER can specify how the alert style looks.
Is this right? Can I not FORCE an alert box to popup at a specified time?
And what about UIAlertView... that looks like what I'm looking for also... can that be used to go off like an alarm clock and x time in the future?
appreciate the input, thanks
No, you cannot do that. The user is the one who decides what kind of notification he/she gets.

Resources