Can we change system setting like airplane state? [duplicate] - objective-c

This question already has answers here:
Activate airplane mode programmatically?
(2 answers)
Closed 7 years ago.
Is there a magic trick to put iPhone on airplane mode ?
I saw this : http://blogs.oreilly.com/iphone/2009/01/bring-airplane-mode-control-ba.html
but it seems to be patched because I didn't managed to success with iOS 9.

You cannot do this with the Public APIs provided by apple.
This may be done using the unreleased Private APIs. But if you use these, you cannot publish your app on the store.

Every single App Store app is sandboxed with entitlements.
What you are trying to achieve is simply not possible if you want to distribute your app in the App Store. Your App simply cannot get enough privileges to achieve anything remotely similar. You cannot set global settings that changes the behaviour of the system. Apple will never allow that.
At the best you can monitor the status of the network connectivity via reachability but this is pretty much it. Using private API = straight app rejection.

Related

How to trigger an UI action when the app is closed in React Native?

Apologies if my question is already answered in any other ways. I am very new to react-native with no knowledge of android or java.
I am trying to make a video conferencing app with react native. I used Agora for video calling and linked it with socket.io and react-native-callkeep for real time experience.
Now i am stuck in a situation where i have to make the app functional when someone is calling and the app is ""Closed"". Something like Whatsapp. I thought of implementing Firebase Cloud Messaging for push notification. And though it will open the application in someway. But the application opens when user opens the notification.
Can anyone please help me with any of the following or better ideas:
1. Keep the socket io open even when app is closed
Or 2. Open my application with incoming push notification (Without Opening It)
Please avoid abstruct answers as i am very new in this sector. I really appreciate the help. Thank you.
I think the second method is the way to go you can also look at this library called react-native-callkeep I think it fits your use-case as well.

iOS 10 Toggle On/Off programmatically 3G/4G data with Private API

So I got a client asking for a way to programmatically reset the data connection of his iPhone. The app won't go to the Appstore so any help is welcome.
There is two possibility but each one does involve Private API uses :
• Toggle 3G/4G On/Off
• Toggle AirPlane mode On/Off
The question is simple :
How to use the Private API to get the wanted result ?
With probability of 95% you won't be able to do that. Apple closed most of private APIs as of iOS 8.4. For education purposes, you could take a look at the iOS runtime headers for iOS 10.1 just to see what's no longer available.
Moreover, as of Xcode 7 you can't even link the private frameworks inside an app that easily - be it for AppStore or AdHoc.
So even if the client device is using a jailbreak, you won't be able to achieve it.
What you could do though - is write a jailbreak tweak and post it to Cydia, or somehow call an existing preinstalled tweak from inside your app on a jailbroken device - though I've never heard anyone do that.

Connecting to iMessage functionality with iOS8

I am making an iPhone app and need to be able to minimally see when a message comes in, when I myself look at it, and when I answer it. I need to see when this happens on the message app that is within the iPhone iOS. I have been looking around for a solution on this and have not been able to find one.
Is this possible to access this data on the iPhone or is it completely closed off?
There is no Messages SDK available currently (as of iOS 8.1) that would allow a developer to interact with (or receive) messages.
The most you can do is to share content through MFMessageComposeViewController.
Be aware other search results suggesting you can use CoreTelephony - you app will be rejected by Apple because CT is a private framework.

Turn iPhone into a server programmatically?

I want to make my iPhone app display on a Mac's screen, kind of like AirPlay does with other machines. The only way I have heard to do this is, although I do not like it, turn the iPhone into a server. Unfortunately, I cannot figure out how to do so. I also wanted to set it up in such a way that my Mac automatically detects it. I have seen a similar setup in the game Chopper 2. My Mac app will have a simple timer that fires every few seconds to look for the iPhone, in the same way that Chopper 2's "Find iPhone" button does.
Is there a simple way to turn the iPhone into a server, or start a "session" like Game Center does?
One last thing: I know it is somehow possible, because another app I have actually gives my iPhone a web address at the click of a button. It is called the Dicenomicon, if you want proof.
First there is no easy way to redirect your display to Mac, even if you made it a server of some kind.
Second, to discover or publish customized services on WLAN, you may want to refer to the samples on Bonjour:
CocoaHTTPServer: a simple TCP/HTTP server.
WiTap: an app that discovers and connects to services of the same kind on WLAN by Bonjour.
I'm not really sure what you mean by "server", because there is no way to share the screen of an iPhone using the official SDK, although this is possible by jailbreaking.
It would be possible, however, to send data back and forth between the Mac and iPhone, and display the data on the iPhone, on a Mac. Using that data, you could try to recreate the interface on the Mac. All of this could be accomplished using sockets. A class that might help with that would be cocoaAsyncSocket, which makes network programming a lot easier.
The auto-discovery of iPhones on the local network is achievable with Bonjour. Without getting into too many details, NSNetService would allow you to publish a service for your app from an iPhone, and NSNetServiceBrowser would allow you to find that service on the local network from the Mac. From the NSNetServiceBrowser, you could establish a socket connection with the iPhone.
Good luck!
You might want to take a look at the GameKit APIs, I know they do something similar between two iOS devices.
http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/Introduction/Introduction.html

How can my application perform a task when it is minimized or be started on certain events?

How can an application perform stuff when its actually closed like google+?
I notice that I got a notification from huddle chat from the google+ app for iOS. But google+ was actually not active, it was closed. Same situation with Whatsapp, I always get push messages both if the app is closed or active.
This kind of behaviour seems for me to be impossible to implement. From other questions I know that we cannot register some kind of background process. How do this apps handle that?
Can I still listen form something when my app is minimized?
When my app is just minimized but not closed I know that a certain method is called. Can I perform a repeating update task, e.g. read geo data?
The apps you mentioned use something called Push Notifications which work regardless of your App being open/in the background/closed. They are notifications sent to the device when an action happens and most of the processing is done on the Server (The notifications are not generated by the App itself. A server pushes the Notification on).
Apple has a fantastic section on Executing Code in the Background when your App is minimised which should provide most of the answers you need. It even has a dedicated section on explaining the Geo Data capture which should help you in this case.