I tried to implement universal links in my application, but it's not working. I uploaded the apple-app-site-association file to my server, i can access it.
(MIME type: application/json)
Here is the content of the apple-app-site-association file:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "L7LAMSGWAK.com.example.app",
"paths": [
"*"
]
} ]
}
}
I turned on the Associated domains in my application, and i added these domains:
applinks:example.com
applinks:demo.example.com
(i uploaded the apple-app-site-association file to the demo.example.com domain too)
In the AppDelegate.m file i wrote this:
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler {
NSURL* openedUrl = userActivity.webpageURL;
NSString* urlString = [openedUrl.absoluteString lowercaseString];
return YES;
}
And i set a breakpoint into this method to check if its called, but its never called. If i click on for example this link: https://demo.example.com/asd its just open the safari, but i never see the banner to open the link in my application. I really dont know whats wrong.
Try to delete and reinstall the app. iOS processes associated domain details and attempts to read the apple-app-site-association file at app install. It worth trying it with a real device (instead of the Simulator) and check device logs (Xcode > Window > Devices and select your device). If you see anything like ### Rejecting URL 'https://demo.example.com/apple-app-site-association' for auth method 'NSURLAuthenticationMethodServerTrust': -6754/0xFFFFE59E kAuthenticationErr, then probably your site's certificate is not good enough for iOS or there is some other issue with downloading your association file.
Kind of a late answer, but I had the same problem when I was trying to implement universal links. The solution for me was to test using a real device.
The Apple documentation lists that it's possible to test on a simulator, but with my own experience, it hasn't been possible.
You can test universal links in Simulator or on a device. Source - Apple
I also tried using Branch.io and they state that it's not possible to test using a simulator.
You should also verify that you're using a device that's running iOS >= 9.2
Related
i am trying to set up deeplinks for my ionic 4 ios app, i followed these steps to accomplish the given task:
i uploaded an apple site association file to the web version of the app, i used the actual bundle id and app id prefix from Certificates, Identifiers & Profiles page on apple.com
i verified the website url using https://branch.io/resources/aasa-validator, i got 5/5 green results
i also enabled associated domains in both xcode and on apple.com dev space for the application
inside the code in the app components i used the following code :
const subDeepLinks = this.deeplinks.route({
'/verify/:code': VerifyPage,
'/reset-password/:token': ResetPasswordPage,
}).subscribe((match: any) => {
this.zone.run(() => this.router.navigate([match.$link.path]));
}
});
And here is the list of the deeplink variables from package.json
"ionic-plugin-deeplinks": {
"URL_SCHEME": "<my-domain-name>",
"DEEPLINK_SCHEME": "https",
"DEEPLINK_HOST": "<my-domain-name>"
}
I test this using iPhone simulator, i created a contact with a url that is supposed to lead to the app. But when i click on it i get redirected to the web version of the app.
Any help is appreciated, thanks!
well, it turned out aasa worked. i used my gf's iphone installed the app and checked. so nevermind
I'm developing an app using theos [application_swift] and would like to gain access to the filesystem, outside the sandbox.
To my understanding, using the [application_swift] with theos should enable me to access files outside the sandbox, but I've tried using FileManager.default.fileExists(atPath:) to access the file I like and the result was that the file was not found.
Worth mentioning I'm obviously running on a jailbroken device running 11.2.
Am I missing something?
I've been able to solve this issue by adding com.apple.private.security.no-container to my entitlements file and adding them using codesign.
codesign --entitlements app.entitlements -f -s "iPhone Developer: xxxxxxxxxxxxxxxxx" MyApp.app
Jailbreak doesn't open everything to everyone, that's not how it works in general and could open different things depending on specific jailbreak. For example, electra on iOS 11 allows me to read SMS database from inside a regular app. But I still can't read someone else's sandbox. It all depends on how jailbreak is implemented and what it patches inside the kernel. It could even be that you can't access anything outside of the sandbox. That's actually would be preferable to preserve security of AppStore apps.
It could also be much simpler - Swift knows which paths you shouldn't try to access and throws an error without even actually trying to access them. Try to access the files with C or Objective-C as these are proven to work without any artificial restrictions.
If you're still looking for the answer to this, you must add the com.apple.private.security.no-sandbox entitlement to your app.
I like your plist permisson change. If you want an alternative, like #Creker said, try stat or access from C.
I have seen your problem, when trying to detect a Frida running on a jailbroken device:
NSString *frida_on_filesystem = #"/usr/sbin/frida-server";
NSURL *theURL = [ NSURL fileURLWithPath:frida_on_filesystem isDirectory:NO ];
NSError *err;
if ([ theURL checkResourceIsReachableAndReturnError:&err] == YES )
return YES;
if ( err != NULL ) {
NSLog(#"[*]🐝Error in file check: %ld", (long)err.code);
if ( err.code == 257 )
NSLog(#"[*]🐝Sandbox permission error.");
}
FILE *file;
file = fopen(frida_on_filesystem.fileSystemRepresentation, "r");
if ( !file )
NSLog(#"[*]🐝if ObjC APIs fails, fopen also failed!");
but then access() - which loads from libsystem_kernel.dylib - works:
return (access(frida_on_filesystem.fileSystemRepresentation, F_OK) == 0) ? YES : NO;
Could anybody help me out please?
iOS Branch deep link does not open application on device, but works well on simulator. My simulator OS version is 10.3, my iPhone 5s OS version is 10.3.3
What I have done:
Dashboard: Settings -> Link Settings:
"Always try to open app" is checked
"IOS URI Scheme" is set to the application's custom URI scheme.
"Enable Universal Links" is checked.
Bundle Identifier & Apple App Prefix are both set correctly.
Link Domain was set as bellow:
Test Link was created as bellow:
Xcode Configuration:
1.Associated Domains
2.Info.plist file
And, code as bellow:
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
[[Branch getInstance] handleDeepLink:url];
BOOL success = NO;
success = [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation];
if (!success) {
success = [router handleURL:url withCompletion:nil];
}
//force return YES
return YES;
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *))restorationHandler {
BOOL ret = NO;
ret = [[Branch getInstance] continueUserActivity:userActivity];
if (!ret) {
ret = [router handleUserActivity:userActivity withCompletion:NULL];
}
//force return YES
return YES;
}
What I tested:
I sent the Test Deep Link to my email, and I open the email through Safari. While I click the url on DEVICE, an alert was shown to tell me App Store will be open. While I click the url on SIMULATOR, my app was open successfully.
I pasted the Test Deep Link into Notes on DEVICE, while I click the url, an action sheet was shown and provide two option: open in Safari, Open in xxx(my app name). I click both options, they all could open my app successfully.
Here is all the configuration, code, steps, and I have also tried to change branch_app_domain to applinks:xxxapp.app.link, it didn't work neither.
Is there anything that I missed during the integration procedure? Any suggestion would be very appreciate. Thanks in advance!
Roby
Amruta from Branch.io here:
I tested with your App available on the App Store and Universal links work as expected. I shared the link via Slack, the default Email App on iOS as well as the Gmail app. On all three platforms clicking on the Branch link for your App opened your App via Universal links as expected.
Based on your description of testing it looks like you are disabling Universal links (clicking the breadcrumb on the top right link disables Universal links.
To re-enable Universal Links for an app:
1. Paste one of your Branch links into a new note
2. Perform a long press on the link (note: if you see a "preview" window pop open, you are pressing too hard)
Note that this is a 'per-device' issue, so if you accidentally disable Universal Links on one phone, it won't affect other users.
Unfortunately, there is no way to ensure that a user does not disable Universal links by mistake. However, there is a silver lining, this will no longer be an issue post iOS 11. With iOS 11 the breadcrumb in the top right corner has disappeared and so has the ability to disable Universal Links.
I implemented Universal Links in my app, and it works like charm.
But after the iOS 9.2 Update it stopped working.
When the app is already installed, and I tap on the link which in iOS9.1 open my app, in iOS9.2 it isn't.
Does anyone have the same problem?
My problem was an old format for the apple-app-site-association.
The old format was:
{
"applinks": {
"apps": [],
"details": {
"1234ABCDE.com.app.myapp": {
"paths": [
"*"
]
}
}
}
}
Update the format fixed the problem, and the new format is:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "1234ABCDE.com.app.myapp",
"paths": ["*"]
}
]
}
}
Can check if the format is right here:
https://search.developer.apple.com/appsearch-validation-tool/
If it says: recommended - old format, so it won't work on iOS9.2, So update to the new format.
Hope it help someone.
This is a known issue introduced with iOS 9.2. Please see https://blog.branch.io/ios-9.2-redirection-update-uri-scheme-and-universal-links for a full description of the issue.
TLDR - It's not known if this was intentional or a bug on Apple's part. What is known is that with the update to iOS 9.2, the model dialog which was previously used to prompt the user to open the app (associated with the URL scheme) is no longer modal. This means that javascript execution continues and if you were previously counting on the modal dialog to prevent redirecting the user to the app store, that no longer works. The end user experience for most apps using URL schemes is that they are ALWAYS redirected to the app store where the button says "open" instead of "get" for the app.
I created a WatchKit Application with the default XCode Template.
I added an app group entitlement to the iOS Target, to the Watchkit App Target and to the Watchkit App Extension Target. (this is the app group name: group.com.lombax.fiveminutes)
Then, I tried to access the shared folder URL with both the iOS App and the WatchKit Extension:
Extension:
#implementation ExtensionDelegate
- (void)applicationDidFinishLaunching {
// Perform any final initialization of your application.
NSURL *test = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:#"group.com.lombax.fiveminutes"];
}
iOS App:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
NSURL *test = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:#"group.com.lombax.fiveminutes"];
// ...
}
However, the test NSURL is different:
On iOS:
file:///Users/Lombardo/Library/Developer/CoreSimulator/Devices/38B983DB-342F-4A47-8C26-5D2C92CDB666/data/Containers/Shared/AppGroup/8DEE182E-AFE6-47DD-BA2B-6B0520158A8B/
on Watch:
file:///Users/Lombardo/Library/Developer/CoreSimulator/Devices/BF52D613-25FF-4092-A5B2-9C3F1B616160/data/Containers/Shared/AppGroup/CECB5EFC-7FBD-4C84-A878-1314CB7CF211/
And for this reason I'm unable to share data between the iOS App and the WatchKit Extension.
I cannon try on a real device since I don't have WatchOS 2.0 on my Apple Watch.
Any advice?
Thanks
UPDATE
I did some other tests:
Installed WatchOS 2, the issue still persists on real devices.
This is the store url for my iPhone:
NSURL
* #"file:///private/var/mobile/Containers/Shared/AppGroup/3D05D159-94D6-409C-9A38-90E0830D0C3F/FiveMinutes.sqlite"
And this is the store url for my Watch:
NSURL
* #"file:///private/var/mobile/Containers/Shared/AppGroup/F1E89377-F456-4FC2-BAAC-3DD705EF381A/FiveMinutes.sqlite"
The two apps reads and write to-from two different .sqlite files.
On simulator, if I hard-code one of the URLs, both iOS simulator and Watch simulator are able to read-write the same .sqlite file and share the content. However, this is not possible on real devices since the Watch extension cannot write to the iOS path:
URL:file:///private/var/mobile/Containers/Shared/AppGroup/3D05D159-94D6-409C-9A38-90E0830D0C3F/FiveMinutes.sqlite options:(null) ... returned error Error Domain=NSCocoaErrorDomain Code=512 "The file couldn’t be saved." UserInfo={reason=Failed to create file; code = 2} with userInfo dictionary {
reason = "Failed to create file; code = 2";
}
Ok, I think I've found my answer. I remembered that with the transition to Watch OS 2 the extension code is now executed directly on the Apple Watch, and no more on the paired iPhone. So it's seems obvious that the two devices doesn't share the same storage.
The first thing I did was to create a new project, starting from a base iOS Project, and then adding a Watch OS 1 (old version) App Target.
In this case, the directories were identical and they could communicate:
Watch Path: file:///Users/Lombardo/Library/Developer/CoreSimulator/Devices/BF52D613-25FF-4092-A5B2-9C3F1B616160/data/Containers/Shared/AppGroup/30B39103-CEEB-4C64-9531-FB27DC40180D/
iOS Path file:///Users/Lombardo/Library/Developer/CoreSimulator/Devices/BF52D613-25FF-4092-A5B2-9C3F1B616160/data/Containers/Shared/AppGroup/30B39103-CEEB-4C64-9531-FB27DC40180D/
Then, I did the first thing every programmer should do: read the docs.
In the FIRST PAGE of the WatchOS 2 transition guide there is this sentence:
Your extension now stores files and data on Apple Watch. Any data that is not part of your Watch app or WatchKit extension bundle must be fetched from the network or from the companion iOS app running on the user’s iPhone. You cannot rely on a shared group container to exchange files with your iOS app. Fetching files involves transferring them wirelessly to Apple Watch.