iOS Universal Links not working via TestFlight - ios

I'm new to iOS and managed to implement the iOS Universal Links for an app following this.
I have created and uploaded the apple-app-site-association and configured/prepared the app to handle universal links.
It all works well and I can test it successfully when I build the app through xCode into a real device. However the universal links do not work when installing the app via TestFlight.
When installing the app via xCode I can see the HTTP request to the apple-app-site-association file in my web server. But when installing it via TestFlight doesn't seem to try to fetch the association file.
Does anyone knows if this is expected or how can get universal links working when deploying on TestFlight?

Make sure your Associated Domains are in both entitlement files: "Debug" and "Release".
In my case all domains were listed in Entitlement-Debug.plist file but the Entitlement-Release.plist was empty.
After adding them manually to the 'Release' file - app installed via TestFlight started working with Universal Links.

Distribution via Testflight will also not work, if you have protected test-Environments and use ?mode=developer to bypass Apple's CDN. Developer mode is only taken into account if the App is signed with a development profile.
Reference here: https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_associated-domains

I was facing the same issue. The fix was to use the same BRANCH_KEY for both Debug and Release mode.

Related

iOS Associated domains webcredentials wildcard domains won't work in device, simulator ok

I'm trying to use shared web credentials. Domains that use wildcards won't work in a device, in a simulator they do work. Device is running iOS 12.3. Xcode 10.1.
My web app is built around WKWebView and it uses subdomains. The entitlements file in the iOS app contains this:
webcredentials:myapp.app
webcredentials:*.myapp.app
When I go to mydomain.myapp.app and request shared web credentials, I will get those credentials in a simulator. The device gives the error:
Error Domain=NSOSStatusErrorDomain Code=-34018 "mydomain.myapp.app not found in com.apple.developer.associated-domains entitlement" UserInfo={NSDescription=mydomain.myapp.app not found in com.apple.developer.associated-domains entitlement}
If I enter the whole domain into the entitlements file, then this works in the device as well. But I don't need that whole domain in the simulator in the entitlements file, the wildcard works.
I'm building for target 10.0. I tried building for 12.1 but it didn't help. Note that I had to copy the "device files" from the Internet (somewhere from GitHub) as my version of Xcode didn't have the device files for iOS 12.3.
Any idea why wildcard doesn't work?
When testing universal links on device, there are a few requirements:
Turn on Developer Mode on the device.
Turn on Associated Domains Development in the Developer settings.
(Developer settings will first occur after you have turned on Developer Mode).
Build the app using developer certificate. (Enterprise will not work).
Add ?mode=developer to the domain in entitlements if you are testing with a domain thats not publicly available (Behind VPN..)

Universal URL does not work when build is archived

I think I implemented universal URL correctly and it is working fine when I launch the app directly from the Xcode but if I am archiving the build and sharing it via tesflight or diawi I am not able to open the app using URL scheme.
Make sure your Associated Domains are in both entitlement files: "Debug" and "Release".
In my case all domains were listed in Entitlement-Debug.plist file but the Entitlement-Release.plist was empty.
After adding them manually to the 'Release' file - app installed via TestFlight started working with Universal Links.
Select All and Add your domain like this.
Make sure you have both release and debug entitlements.

iOS app upload to iTunes Connect results in Invalid Signature issue

I'm working on a hybrid mobile app project (Ionic framework) and releasing to Android, iOS and web. This issue concerns only releasing the application on iOS.
I ran into an issue whereby I suddenly started getting the following email from iTunes Connect after building, archiving and uploading my iOS app to App Store from Xcode.
App Store Connect: Your app "YourAppName" (Apple ID: XXXXXXXXXX) has
one or more issues
Dear Developer,
We identified one or more issues with a recent delivery for your app,
"YourAppName". Please correct the following issues, then upload again.
Invalid Signature - A sealed resource is missing or invalid. The file
at path [YourAppName.app/YourAppName] is not properly signed. Make sure you
have signed your application with a distribution certificate, not an
ad hoc certificate or a development certificate. Verify that the code
signing settings in Xcode are correct at the target level (which
override any values at the project level). Additionally, make sure the
bundle you are uploading was built using a Release target in Xcode,
not a Simulator target. If you are certain your code signing settings
are correct, choose "Clean All" in Xcode, delete the "build" directory
in the Finder, and rebuild your release target. For more information,
please consult
https://developer.apple.com/library/ios/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html
Best regards,
The App Store Team
I tried everything I could find on the internet regarding this issue:
Checking over my certificates, provisioning profiles, recreating them, updating Xcode, building the project again, made sure I'm using a distribution certificate not an ad-hoc certificate, verified the code signing settings in Xcode were correct, verified the bundle was built using the Release target, tried the "Clean All" option, deleted the "build" directory in the finder and rebuilt the release. In short - I tried everything I could find by Apple regarding this issue, also looked up the same issue in StackOverflow and tried a huge variety of the recommended solutions. I tried all of those options multiple times over to make sure I didn't miss anything.
Nothing worked...
Also a note that I was able to upload to App Store without any problems before. There hasn't been any changes to the project which could result in this Invalid Signature issue arising - no certificates have expired, no new ones have been created, no new provisioning profiles have been created. The same profiles and certificates were used which worked just fine some time ago. iTunes Connect just suddenly started responding with this issue.
What else can I try?
I was sceptical at first when I tried this solution but this actually solved my issue.
Find a spare USB stick or an external hard drive.
If your Mac's filesystem is APFS format the external volume using a HPFS Mac OS Extended (Journaled) file system. Move your project over to the freshly formatted HPFS external volume and rebuild it over there. This is important as if you build it on your Mac's APFS volume and then move it over to your HPFS external volume to archive and upload in Xcode this will not work!
The project needs to be built, signed, archived and uploaded ON the HPFS volume.
The uploading to App Store should now work again. It worked for me, hope it works for you as well.
See more information on the solution here

Debugg iOS Cordova app

I have built an iOS app with Cordova and I'm trying to debug it with my Mac. I have followed this tutorial, but when I go to Develop -> iPhone xxx there is no apps able to be debugged.
I have built the app using Intel XDK tool. Is there a way to enable debugging in my iOS app?
Thanks.
EDIT
I have tried to debug my app with GapDebug but it doesn't recognize my app as debuggable.
I have created my app with a production/distribution certificate, not with development one. Maybe, can it be the reason why I can't debug my app?
Every Application you create with cordova is compiled with an activated Debugmode. If it is not, you're able to change this via https://stackoverflow.com/a/12499274/3671726
Instead of debugging your Application with Safari, i would recommend you to install Google Chrome and GapDebug in combination. Go on that website, check out that video - you'll love that tool. Is very impressive, how and how smart gapDebug handles your debugging.
Solved
Like he found out on himself, he compiled the application with the wrong certificate. So be sure to use a provisioning profile which includes a development certificate and not a distribution certificate.
I was using a distribution/production certificate to sign my app, so I couldn't debug it. I have created a new provisioning profile with a development certificate and now it is working like a charm.
I'm using GapDebug like said Sithys. It is a good tool, thanks.

PhoneGap application built with "PhoneGap Build" submission to App Store

Is it possible to generate a binary via https://build.phonegap.com/ which will be ready for submission in the App Store?
I don't want to do it through Xcode but only via "PhoneGap Build". The FAQ and press release state that it is possible:
Quickly and easily get back app-store ready apps for multiple platforms,
including: *Apple iOS*, Google Android, ...
So, I have successfuly built and tested my app on both android and ios. In addition I have successfuly built a release ready version for android store (google play) and submitted.
My problem is that I cannot seem to be able to do the same for App Store. While trying to submit with the Application Loader I get:
Application failed codesign verification. The signature was invalid,
contains disallowed entitlements, or it was not signed with an iPhone
Distribution Certificate
Unable to extract entitlements from application:
/var/folders/vr/ghc8p.../T/APPNAME.ipa/Payload/APPNAME.app/APPNAME
Note that I did use the distribution certificates for building the .ipa from PhoneGap Build
Any idea where I should look next?
It turns out that it was a PhoneGap Build bug. The old certificates seem to have been cached. I deleted the application (in PhoneGap Build) and all my certificate configurations. I created a new application and a new certificate configuration with the last good distribution certificates that I had previously used when I posted the question.
The build was successfuly accepted from the Application Loader.
So this was a PhoneGap Build bug.

Resources