Can you change the default Apple Watch watch? - ios

I'm planning to make an watch app for the Apple Watch.
Is there any way of replacing the default home screen (or watch) of the device to be a custom watch?
Assuming there is none, the next best way would be to make a WatchKit App complete with with a Glance?
Does the apple watch come with a power saving mode by default where it will turn off the screen/running app reverting to it's home screen after a certain period of inactivity?

There is not at present any way to have a custom watch face. You could make an app with a glance view, but just to be clear a glance view cannot contain any buttons or interactive elements, it's just something to be looked at. If the user taps the glance it will open your watch app.

Related

Show advertisement at regular interval of time when iPhone is running

I am working on the app that shows Ads (Video or image) when iPhone is running. If I open any app(eg. Twitter) then also my Ads should be visible at particular interval of time. Is it possible to do so?
No. Your app will not be informed about any other apps being launched. Even if it were, you can't "force-grab" the foreground to display videos. That would totally violate any user interface principle established by iOS.
Besides the technical aspect I'd have my doubts of such an app surviving app review in general, though I don't know the specific part of the TOS right now.
It is possible to show your ads inside your application in intervals or in any pattern you like. However it is not possible to bring your app to foreground when in background to play ads, it is actually not recommended at all. Best thing you can do is set a timer when the app gets in background to send a notification.

watchOS 3 app restarts after tapping complication

I have a simple "timer" watchOS app that uses hierarchical navigation. I can press the digital crown to return to the watch Springboard, then tap the app icon and be returned to the same interface controller I was using.
If I return to the watch face and tap my app's complication, the app is launched, but appears to have restarted: I lose my current state. Is there any way to prevent this?
It sounds like you're asking how to stop your app being swapped out of memory?
If so, just like on iOS this isn't possible - and obviously the watch has less memory than a phone so is more likely to be swapped out.
What you need to do is store your state in some persistence layer - e.g. NSUserDefaults - so when the app restarts it can reload its state
If you open your watch app by tap complication, the app will automatically back to root interface controller(s). This is a system forced behavior.
If you want to preserve previous state, you need to change your app's hierarchic to page-based interfaces.
User interaction in page-based interfaces can be just like navigation-based interfaces. You can replace pushController(withName:context:), pop() and popToRootController() methods to becomeCurrentPage(). I also found switch from one page interface to another is also faster than navigation (push/pop) to another.

WatchKit event for "devices not paired"?

I want to be sure that when the Watch is not paired with an iPhone the user is warned with the right info. I saw that when I turn off bluetooth some other applications show a full screen red device icon with the name of the app in white, indicating that the device is not paired and that the app needs the pair to work. When I do the same using my App nothing happens, I'm still getting only a little icon next to the time on the to right (or left depending on wrist...) corner, not the full screen icon.
I wonder if is there a specific way to show that state to users or if it should be an automatic function handled by the system that, for some reasons, is not working for me.
Don't know about the automatic function but using WatchConnectivity framework you can get to know if the paired iPhone is reachable or not . If not you can show an interface controller with proper message to warn user. WCSession has a boolean property reachable whose description is as under.
Discussion
In your WatchKit extension, the value of this property is
YES when a matching session is active on the user’s iPhone and the
device is within range so that communication may occur. On iOS, the
value is YES when the paired Apple Watch is in range and the
associated Watch app is running in the foreground. In all other cases,
the value is NO.
For more detail check WatchConnectivity Framwork

iOS - show consistent alert at the top of the UI when backgrounding the app (like personal hotspot does)

I am creating an alarm clock app that requires some user action within the app in order to turn the alarm off. Below is a picture of what another app, Sleep Cycle, does when you turn an alarm on and press the home screen (i.e. background the app).
Here is an image link (I can't post an image yet, no rep despite my many attempts to answer people's questions today) for the effect I want to re-create.
Those that have used iPhone's Personal Hotspot and connected a device will notice that it is the same effect, where a notification appears at the top of the UI - pushing everything down by around 20-40 points. This is highly desirable to an alarm clock app as it encourages the user to keep the app in the foreground so that the app can easily be entered when waking up (instead of relying on the 30 second sound window allowed by local notifications)
Does anyone have any ideas on how to implement this functionality. I assume that it must go somewhere in the:
- (void)applicationDidEnterBackground:(UIApplication *)application
tag within the AppDelegate, but I'm not sure what exactly I need to be reading up on. So if anyone has a link to some relevant Developer Docs that would also be extremely helpful.
Many thanks for your help,
Ryan
There are a handful of built in 'background modes' that change the status bar's appearance depending on what functionality an app provides whilst it's in the background. The one you've identified (a red status bar) is triggered when an app records audio whilst in the background. I presume Sleep Cycle must be acting as though it records audio just for this purpose. Other background modes include VoIP (which I think uses a blue status bar). Check out Apple's documentation on supporting these various background modes
In your case, you'd want to add audio to the UIBackgroundModes property in your Info.plist file.
But note that it wouldn't be unreasonable for Apple to reject an app during review if it pretends to perform one of these background tasks but doesn't. For example, there have been apps in the past that tried playing a silent audio clip continuously in order to stay awake in the background - needless to say Apple got wise to this and the app in question had to change its behaviour.

Changing the behavior of the iOS Lockscreen

Is there a way to change the behavior of the iOS Lockscreen? For instance, can an app, if active, provide a user with dynamic content, such as pictures, as the phone's background, and, in addition, allow a user to swipe left (in addition to swiping right, if they want to unlock the phone) to engage said content?
Is there a way to change the behavior of the iOS Lockscreen?
No.
For instance, can an app, if active...
No.
iOS doesn't provide any API that would allow the sort of thing that you describe. It might be possible to modify or replace the lock screen if you jailbreak your phone -- all bets are off at that point. But an app that uses the Apple-provided API has no way to modify the lock screen.
Also, note that if the device is locked, your app won't be active. You may have intended a looser definition of "active," but looking at the linked chart of app states will help you understand that what you're looking to do isn't achievable with the current API. Apps have to be active to receive events, but a locked phone implies that your app will be in an inactive, background, or suspended state if it's running at all.
No. (Not if you're talking about an 'app' in the sense of the App Store)
The only way an app can interact with the lock screen is through notifications, and cannot alter the standard lock screen interface.
You can alter the lock screen with a MobileSubstrate tweak on a jailbroken phone, but this requires reverse-engineering SpringBoard (the iOS launcher app), can be quite complicated and obviously cannot be distributed through the App Store

Resources