Make phone call from Apple watch app - apple-watch

Can we use a button to make a phone call from the apple watch app?
For iPhone app we can use once the button is pressed:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://1111111111"]]);

openURL is silently ignored if the device is locked or the app is in the background. Additionally WatchKit doesn't contain an API for initiating a phone call.
Your best bet may be to prompt the user to open the iPhone app, possibly using Handoff, and tap a button to initiate the call from there. Not a great solution, but WatchKit is pretty limited right now.

It's now possible from WatchOS2 :
if let telURL = NSURL(string: "tel:5553478") {
let wkExtension = WKExtension.sharedExtension()
wkExtension.openSystemURL(telURL)
}
cf1,
cf2.

You can't do this on Apple Watch itself. But there alternative ways like:
Tell the user to call the phone in the companion iPhone app
Use Handoff to jump from Apple Watch app to the companion iPhone app with just a tap on a button (a more user-friendly way)
NOTE: The best way is always waiting for new versions. In WWDC 2015 taking place in San Francisco (June 8-12), they will introduce WatchKit 2 with support for the companion kits on iOS and the native watch apps that run on Apple Watch without having the iPhone nearby.

Related

Embed App Store in my app

I see games in the App Store that allow you to download other games. Rather than app switching to the App Store to download the other game, it brings up an embedded App Store within the app itself.
Zoo Country is an example of an app that does this.
The only way I know of to bring someone to the app store to download another app is to do something like this, but this switches apps:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"itms://itunes.com/apps/appname"]];
How is Zoo Country embedding the App Store?
You want to use the SKStoreProductViewController class. Docs here.

Opening iCloud.app in iPhone application

How to open iCloud.app in my own iPhone application? The only information I have ables me to open Setting.app through this line of code
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"prefs://"]];
but I want to check if the calender is on/off in iCloud on the iPhone.
So when I run my own application I want to move directly in iCloud through my application.
How to access iCloud in iPhone applications?
There is no such app as the iCloud app. I presume you are talking about the iCloud menu in the settings app, there was a brief time in iOS 5.0 where you could use the prefs:// URL scheme to access menus in the settings app, however Apple disabled that in the very next update.
Hopefully it wills return in the future, but even if it does there will still be no way to programmatically determine the status of settings (such as icloud calendar sync) or manipulate the settings.

Setting app defaults for iOS 5 Notification Center

Does anyone know how an app can control its defaults in iOS 5 Notification Center? I have written a timer app using local notifications to alert the user when the timer goes off in background. When I upgraded to iOS 5, all notifications (alerts, sounds, lock screen) reverted to “off”. Needless to say, this is a terrible default setting for a timer app.
I’ve seen this happen with other apps, such as OmniFocus under iOS 5, but I’ve seen other apps like Pomodoro default to reasonable Notification Center settings.
I’ve checked the iOS 5 docs, notably the iOS 5 App Programming Manual, and the iOS Human Interface Guidelines, but haven’t found any information on this topic.
Has anyone discovered any pattern at all to the default settings?
Apparently, the app has to register itself with the Notification Center to be listed there; and then enabled by the user.
When I moved to XCode 4.2, my app did not show up in the notification center and I freaked out! Looking on the web a bit, I found the answer.
I have this code in the app's AppDelegate and all is fine now:
// Register the app for the Push- and Local-Notifications on iOS5 - else the users will not get the Local-Notifications
//
[[UIApplication sharedApplication]registerForRemoteNotificationTypes: UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeAlert |
UIRemoteNotificationTypeSound];
Sam.
As far as I have discovered, it is not possible to edit the Notification Center Settings from a third party App.
I really hope Apple releases an update that addresses this issue. I also have a birthday reminder App that is totally useless unless the user edits the Notification Center Settings manually .

Programmatically changing the iOS lock-screen

I'm building an app which would have to have the ability to show my own views on the iPhone lock screen. I've seen lots of apps which let you customize the lockscreen and so forth and these were App Store apps so i'm guessing it has to possible.
I just can't figure out what to use in the iOS SDK to even try implementing this.
Oh and P.S: same goes for wallpapers—can we change this from inside our app?
It can be changed programmatically (change to SpringBoard), but it won't make the way to the (official) AppStore. So if you want to build an app that can change something like the lock screen wallpaper or the ring tone which you usually need the Settings app for, you have to publish your application via Cydia, not Apple's store.
For a sample code block, see this answer.

How do I cause a telephone call to be made in the background in iOS 4.0?

I would like to be able to make a call from within my application, but have it start in the background using the new features in iOS 4.0. I tried using the following code:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"tel://09650159343"]]]
but this causes a call to be made in the foreground, terminating my application. Is is possible to make a call and have it start in the background?
I'm sorry to tell you that this will never ever work, at least not on a non-jailbroken device.
Even on a jailbroke device this won't work the way you approach the problem. opening an url will always opens the associated application to handle it.
before iOS4 this terminated the application, but now with fast app switching this should make the app in the background if you ask me. But it doesn't, this was forgotten on apple's to do list for iOS4?