Apple Watch extension only installing for certain users - ios

The app is in the App Store. The phone companion app installs on the phone just fine, but for some users it (randomly) fails to appear/install on the watch. The app does not show up in the "My Watch" listing in the iPhone Watch app either.
I saw a variety of advice sites saying this can be resolved by doing things like resetting / re-pairing the watch. Also, the app has always been approved pretty swiftly when submitting to the App Store.
So my question is: can it be something code/setup related that can be fixed at the dev level? Or is this just a pesky Apple bug?
Most users are on latest iOS/watchOS versions (11.4/4.3.1)

OK, so problem was a mismatch between OS version on the device and the target version for the watch extension in XCode. If the target version is greater then the watchOS version on Apple Watch, the app will not show up in the Watch app listing and will not install, when auto-install is on. Unfortunately, all this will happen silently, with no warning or cue in the UI.

Related

Can't upload binary with App Clip target to App Store - ERROR ITMS-90834

I added AppClip target to my project, and followed Apple's own documentation. It runs without any error on both simulator and real device.
As it's explained in related WWDC videos, and this article, in order to configure default or advanced app clips experiences, apps have to be uploaded to App Store Connect.
I am using Xcode's Organizer to upload my binary, but I am receiving the following error.
ERROR ITMS-90834:
"Unsupported content.
This app contains an app clip.
Apps with app clips cannot be submitted at this time."
How can I pass this? Is there any other way to configure and test App Clip launch experiences?
App Clips should be fully operational now on iTunes
Outdated answer:
I found this answer by an Apple Engineer on developer forum.
This feature will be available later this year but I can't provide an
exact date. In the past, new features of TestFlight or App Store
Connect were often made available before the general availability of
iOS versions.
It looks like we need to wait some time to test App Clips.
It's available now.It happened with the recent update of TestFlight (when they changed the TestFlight icon)

WatchOS app not detecting companion iOS app

I am making an independent Apple Watch app (but with a companion iPhone app which is not necessary for the watch app to function.)
The app uses WatchConnectivity to sync data between devices if iPhone companion app is installed. I am able to call session.updateApplicationContext() on the iOS app and receive session(didReceiveApplicationContext) on the Watch app. But going the other way is not possible. I always get an NSError code of 7018 which means the iOS companion app is not installed.
I have made sure both watchOS and iOS app are installed in simulator (and tested on my actual devices, iPhone 11 & Watch series 5.) But getting the same failed results from watchOS -> iOS.
I noticed there is a new WCSession instance variable available for watchOS 6.0+ isCompanionAppInstalled. When I read this variable after my WCSession is activated on my watch app, it always return false.
Is there anything else I need to look out for? I am thinking maybe there is something I did wrong in all the different info.plist. But I have checked them multiple times.
my info.plist files:
In my watch app:
WKWatchKitApp is YES
WKCompanionAppBundleIdentifier is com.abc.myapp
In my watch extension:
App can run independently of companion iPhone app is YES
NSExtension
WKAppBundleIdentifier is com.abc.myapp.watchkitapp
NSExtensionPointIdentifier is com.apple.watchkit
iOS app bundle identifier is com.abc.myapp
watchOS app is com.abc.myapp.watchkitapp
watchOS app extension is com.abc.myapp.watchkitapp.watchkitextension
Is there anything else I might be overlooking?
Thank you very much for any help/insight you can offer into this.
Ok. I found a way to get rid of the error and have the watch connectivity work from watch to iPhone.
Originally I wanted the watch app to be independent so in the watch extension target in Xcode, the check box "Supports Running Without iOS App Installation" is checked. But as soon as I uncheck this box, WCSession.isCompanionAppInstalled returns true and error goes away. Syncing from watch to iPhone starts working.
So hopefully this is not intended behavior and will soon be fixed by Apple. (I filed a bug report.) But for now, I am just going to leave the independent watchOS app unchecked because I do want WatchConnectivity in case iPhone app is installed by user.
Thank you for reading and good luck with your programming.
If you have "App is only available as a standalone watchOS app" in Info.plist, delete it even if it is false. Leave only "App can run independently of companion iPhone app". Also don't forget to set "WKCompanionAppBundleIdentifier" for Watch App (not extension). At least it works on real device for me with these parameters.
This seems to be a bug. Sometimes when I start my WatchOS app, it gets WCSession.isCompanionAppInstalled = false all the time, even though the companion app on the iPhone is running, and other apps are able to communicate with the phone.
This seems to go away when I force-restart the app on the watch (press side button, then swipe the app to the left and press the big red button, then start the app again). After the restart, everything seems to work fine.
This has happened only on Testflight builds so far. If it happens in production builds, I'm going to file a bug.
My iOS app will not launch in the Simulator if I uncheck "Supports Running Without iOS App Installation".

TestFlight alert while testing update: You already have this app installed

I was trying to test update scenario from live App Store app build to RC using TestFlight, but TestFlight gives me alert "You already have this app installed. Do you want to replace..." (see below screenshot). After confirmation, all data from App Store version is gone.
Steps I do:
Install live app from the App Store
Login and do some operations to get data in the app and Keychain
Go to TestFlight iOS app
Tap "Install" button in TestFlight -> alert "You already have this app installed" appears
If I tap choose Install, new build is installed
Result:
The app's content including Shared Container (data shared with Extensions) and Keychain are completely wiped when I open the app again
Edit: The alert in TestFlight appears with any app (I have tried multiple different apps from different dev accounts). The actual data deletion happens only for some.
My question:
Is this expected behaviour from TestFlight or is it any issue with my app? I'm not aware of any changes between versions which could cause any issues.
I believe this was not happening before (the last time I tried was few weeks ago).
I couldn't find any documentation or release notes regarding TestFlight app behaviour or changes.
Did anyone experience the same issue? Or do you know any resources describing this behaviour?
Thanks for any answers!
After long research, trials and errors, creating radar and releasing update to App Store, I have an answer:
Alert is there always and does not have relation to losing data.
The alert with warning about possible lose of data is being displayed always for any app being installed from TestFlight over the Non TestFlight Build.
This was true for any of multiple apps I have tried.
identifierForVendor changes when overwriting app with TestFlight build.
When you have App Store version of the app installed and overwrite it with build from TestFlight, result of [[UIDevice currentDevice] identifierForVendor] changes
This is unexpected since it is not mentioned in the documentation (see below)
In my case unexpected change of identifierForVendor was causing "loose of data" which wasn't actual lose of data, but it is happening only for TestFlight builds which you cannot debug, so it was hard to find the issue.
Documentation of [[UIDevice currentDevice] identifierForVendor] says:
The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. The value can also change when installing test builds using Xcode or when installing an app on a device using ad-hoc distribution.
as per best of my knowledge,
if you have installed application from App Store (suppose of version number 1.0) on your device, and lets say your are again downloading/installing same app with same version number 1.0 from TestFlight, you will get above message.
This is because you are trying to install app with same version and bundle id that already does exists on device.Offcourse you will lose data/settings of app, as its replacing your app not updating.I also gone through this scenario.
If you have the full version of an app installed on your device and you install the same Beta App, your app data may be corrupted or lost and may not be recoverable. You should back up your information before installing a Beta App.
http://www.apple.com/legal/internet-services/itunes/testflight/sren/terms.html
I don't know how this happens

App Store Review and Watchkit

I've uploaded an app that got approved with an apple watch version. But in the latest version, I want to upload it without the apple watch version. Does anyone have any information on this?
V1 = iOS + Watchkit
V2 = iOS only
Does anyone know if Apple would allow this? I've tried contacting them, no response yet.
iTunes Connect does not allow uploading an updated version of an app when the update runs on fewer devices than the version of the app currently in the App Store. This is by design.
An update to an app must work for every customer who has already
purchased the app, and is running a current version of iOS.
Developers who wish to issue updates, but remove device support, have three choices:
Fix their app so that it can work on the devices they originally set out to support.
Target a newer version of iOS that requires a newer device.
Remove their app from the store, and upload the new app with a different bundle ID.
↳ https://developer.apple.com/library/ios/qa/qa1623/_index.html

"Cannot connect to iTunes store" when restoring iOS In App Purchase in iOS simulator

I've looked through the many existing questions related to "Cannot connect to iTunes store" issues with iOS StoreKit and I don't think my situation is covered:
When running in the iOS Simulator, I get the "Cannot connect to iTunes store" error after restoring a previous bought in app purchase. If I hit Cancel, the popup goes away and the restore is successful.
There is no problem at all when buying the in app purchase, only when restoring.
Also, the problem only occurs on the simulator, not when testing on a real iPhone.
I'm pretty sure everything is OK, just wanted to confirm that it is just a simulator bug. Any one else seen this one?
Having researched this as much as I can, and confirmed that there are no issues when running on a device, either in sandbox mode or (since yesterday, when the IAP was approved by Apple) using a real Apple ID, I'm assuming this is a simulator bug and can be ignored.
Contrary to the answer posted by iLive below, and repeated elsewhere on SO, testing IAP on the simulator is explicitly supported by Apple, except for hosted content downloads.
UPDATE: It would appear that since iOS 7, testing IAP on the simulator is no longer properly supported. I've had it working using the non-64bit simulator, but not with the 64bit iPhone simulator. Your milage may vary. As per pix's comment below, Apple also seem to have removed mention of iOS simulator testing from their documentation.
I do not believe you can test your purchases with the simulator.
From the "In-App Purchase Programming Guide":
Store Kit does not operate in iOS Simulator. When running your application in iOS Simulator, Store Kit logs a warning if your application attempts to retrieve the payment queue. Testing the store must be done on actual devices.
If you look at this link, Apple tells you about what you should do:
http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/DevelopingwithStoreKit/DevelopingwithStoreKit.html
You can also check out this link: restore button for in-app purchases error
Hope this helped!
I ran into the same problem. I would get the "Cannot connect to iTunes Store". If you press Retry it will send you to the login prompt. However, if you press cancel, you will get "Restore Purchases Successful". This does seem limited to the simulator.
https://developer.apple.com/library/ios/releasenotes/DeveloperTools/RN-Xcode/index.html#//apple_ref/doc/uid/TP40001051-SW241
StoreKit (In-App purchases) will not work in the Simulator. 13962338
Make sure you use an account which is an sandbox user. I tried to use my personal iCloud account on Sandbox which got rejected with the same error.
As of recent (Version 8 and onwards) Xcode releases, I'd qualify the state of StoreKit in the simulator as partially implemented.
Apple officially says you need to test it on the device, however some calls seem to supported in the Simulator – at least the SKProductRequest always works flawlessly. Completing a purchase may or may not work.

Resources