Handling phone shut down event in iOS [duplicate] - ios

This question already has an answer here:
Is it possible to raise an event when iPhone shuts down?
(1 answer)
Closed 8 years ago.
I was wondering if I can be able to detect when the user turns off the phone. Is it possible? Does apple allow it? If they do, how? Thanks.

As shutting down the device is an external event and has nothing to do with your app, you won't be able to find out if the user is trying to turn it off. The only thing you can actually find out is when your application is going to enter the background, what does not necessarily mean that the user turns the device off.
Checkout UIApplication Delegate Ref

As far as I know there are only few notifications allowed from the UIDevice, you can find them here.
There are some undocumented private frameworks, which could provide you such information, but if you use them, your app will be rejected.

Related

iOS: Is it possible to programmatically disconnect a call?

Is it possible to disconnect a call programmatically? I know call kit can be used to make VOIP calls/ block users but is it possible to install an app and lets say user is busy and just by enabling a flag in the app just send them all to voicemail or disconnect without user interaction?
UPDATE
Someone marked the question as too broad. It is a simple question, is it possible to 'Programmatically disconnect a call'. not sure how this can be marked as too broad.
No, this is not possible.
Stack Overflow says my answer is too short... what else can I say? I make iOS apps since 2012, I know which APIs there are. It's hard to prove that something doesn't exist, other than saying "I would know it if it were possible."

How to record call in iOS? [duplicate]

This question already has answers here:
How can I record a conversation / phone call on iOS?
(5 answers)
Closed 5 years ago.
I don't want to see "this is not possible in apple", beacause there are some applications which are already on app store and they record call conversations. So please give me some idea on how to record call conversation in iOS application.
All active Audio sessions are put on halt when the call is active on iOS platform. It is not supported by Apple by design due to security & performance reasons. In short it's not possible to achieve what you mentioned without Jailbreak.
Apple Will not allow it. You can create your VOIP setup and then you can record call. Jail break is another option. There are Cydia tweaks which are able to do that. For example CallRecorder.

How do I make a live text feed for announcements in my app? [duplicate]

This question already has an answer here:
How to send in-app announcements to people using my iOS app?
(1 answer)
Closed 7 years ago.
I would like to add a text feed to my iOS app. Basically, it would just be an updatable UITextView or UIScrollView that would display announcements/news (not an actual news or RSS feed though) on the home page. I want to be able to update this field remotely from my computer to give it a set number of messages/announcements to display one after another in a loop. I don't want to have to update the app to manually add them in via Xcode. I only know Objective-C.
How would I do this? I can't seem to find any tutorials for it. Maybe I'm just not searching in the right way. Can someone refer me to a guide or tutorial or even just a GitHub project I could implement? Thanks.
Edit: I see that a similar question has been asked after all, but I still don't understand the answer given. I'm still new to coding apps so I don't know how to use "initWithContentsFromURL." The person clearly knew what they were doing and so they did not get further explanation. Are there any good guides on how to implement this? I understand you would need to set up a website to store the data, but I'm not quite sure how you would do that. An example of the whole process of setting up the website to store this data and then retrieve it with the function would be helpful.
Look at push notification APN, there is a good tutorial for how to implement push notification
If the messages will only be displayed while the user is inside the app, there is no need for push notifications (which will also allow you to contact the user when the app is closed). The app can simply check with a remote server for the most updated content that needs to be displayed whenever the user launches the app (or whenever he/she enters the screen, or once a day - depending on how often you plan to update that info).

Can I get user's phone number by requesting for permission in ios 6? [duplicate]

This question already has answers here:
Programmatically get own phone number in iOS
(9 answers)
Closed 9 years ago.
I am building an IOS6 app which requires the user's phone number,
Is there a way to ask the user for permission and get the number in programmatic way?
Or he has to manually type it in?
I am using Xcode 4.5 if it matters..
You can't get the phone via any easy API within iOS. There might be a way to do it via the technique described in this related question, but this is a few years old and Apple may have closed this hole (which uses an undocumented key). I also wonder if Apple wouldn't allow the app on the App Store for privacy reasons. Probably not.
You'll have to trust the user to type in the correct phone number if you prompt him/her to.

How to minimize an ios app [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Force app to close and run in background
I'm creating an radio application in ios. There is a minimize button in my application. So what I want to do is when user press that button the application should be run in the background and the app icon should be displayed in the notification area like normal Android radio app. I want to know is it possible in iOS and how can I do that. Any one can show me an example.
Thanks
The only way to make ones application goes to background programatically is to open another app (Safari) calling its URL. But I don't think that is what you have in mind (since you are saying you have a radio app).
So if you want to imitate the same action which happens when user pressing home button, it is not possible with iOS SDK. From iOS human interface guildelines
Don’t Quit Programmatically
Never quit an iOS application programmatically because people tend to
interpret this as a crash. However, if external circumstances prevent
your application from functioning as intended, you need to tell your
users about the situation and explain what they can do about it.
Apple also says in the documentation
People, not applications, should initiate and control actions.
Although an application can suggest a course of action or warn about
dangerous consequences, it’s usually a mistake for the app to take
decision-making away from the user. The best apps find the correct
balance between giving people the capabilities they need while helping
them avoid dangerous outcomes.
So I don't think it is possible using public API.

Resources