I'm trying to implement Firebase Dynamic Linking.
i have created project on firebase console and provided the required
value(prefx and appid).
i also have allowed the association domains from developer console
and it is sucessfully showing true flag.
in xcode i have on the feature of association domain and added the url identifiers etc.
Problem: still the problem i'm facing is that Association Domain Section says
Add the Association Domains feature to your App ID.
don't know whats the reason why i'm getting this error.
The screen shot is also attached for prove.
i have figured this out by searching for long time.
This is basically not a big issues the error
“Add the associated Domains feature to your App ID”
Will go away once you enable the Associated Domains in your APP ID in developer.apple.com. If it doesn’t go away, quit and relaunch the xcode few times and it will work.
reference: https://medium.com/#abhimuralidharan/universal-links-in-ios-79c4ee038272
I had a similar problem. The problem was solved when I turned off and turned on the feature in Capabilities. But then I had several entitlements files in different folders. Steps to combine these files into one:
Open in text editor MY_PROJECT_NAME.xcodeproj\project.pbxproj
Find CODE_SIGN_ENTITLEMENTS and set correct path. Example:
"MY_PROJECT_NAME/Entitlements/MY_TARGET_NAME.entitlements"
I do not recommend using a standard text editor, since it can automatically replace some characters in the file while saving.
You need to add Associated domains to your App Capabilities. Please see screenshot. Add applinks:yourdomain.com
Then Use below code to get Short URL
guard let link = URL(string: "https://www.yourdomain.com/share_location.html?Id=\(RandomID)&uid=\(uid)") else { return }
let dynamicLinksDomain = "yourdomain.page.link"
let components = DynamicLinkComponents(link: link, domain: dynamicLinksDomain)
// [START shortLinkOptions]
let options = DynamicLinkComponentsOptions()
options.pathLength = .unguessable
components.options = options
// [END shortLinkOptions]
// [START shortenLink]
components.shorten { (shortURL, warnings, error) in
// Handle shortURL.
if let error = error {
print(error.localizedDescription)
return
}
print(shortURL?.absoluteString ?? "")
}
Related
I'm using ASWebAuthenticationSession authorization for my application.
It works fine before macOS12.4, but occur unresponse's issue.
After "session.start success", Click Cancel or Continue and there is no response.
var session = ASWebAuthenticationSession.init(url: url, callbackURLScheme: "http", completionHandler: completionHandler)
guard let provider = NSApplication.shared.keyWindow!.contentViewController as? FlutterViewController else {
result(FlutterError(code: "FAILED", message: "Failed to aquire root FlutterViewController" , details: nil))
return
}
session.presentationContextProvider = provider
if(!session.start()) {
NSLog("session.start fail");
} else {
NSLog("session.start success");
}
Edit: I just noticed I did not read correctly and missed the fact that this question was for macOS, not iOS. I still hope one of those answers might lead to a solution.
I have noticed 2 things that seem incorrect to me.
The first one is that you need a strong reference for your session. This limitation is only valid for iOS version < 13.0.
This means, the session variable must "outlive" the invoked method it was started in, e.g. setting a session attribute for the whole class.
I cannot see something similar in the code snippet you provided, it looks like a scoped variable to me.
From Apples documentation for this feature:
For iOS apps with a deployment target earlier than iOS 13, your app
must keep a strong reference to the session to prevent the system from
deallocating the session while waiting for authentication to complete.
The second thing is your callback URL scheme seems to be set to https.
The scheme should match your apps bundle ID.
It must be configured in your Info.plist file. Here's an example how to achieve this. It should actually be something like com.company.myappname instead of http. Your authentication provider would also need to redirect to com.company.myappname://someurl to make this work. Please note the :// must not be part of the callback URL scheme, only the part before that.
I made a music app for macOS that need the access of the file on disk. I can get the proper url, but I can't access the file. To figure out that problem, here I create a concise code snippet to concentrate on the question itself.
.onAppear {
var url = FileManager.default.homeDirectoryForCurrentUser
url.appendPathComponent("Downloads/Test.txt")
var text: String = ""
do {
text = try String(contentsOf: url)
} catch {
print("ERROR: \(error.localizedDescription)")
}
}
The output would be like this
ERROR: The file “Test.txt” couldn’t be opened because you don’t have permission to view it.. So I noticed App Sandbox in Targets > Signing & Capabilities. But at the list of file access (as you can see in the following picture), there's only User Selected File, Downloads Folder, Pictures Folder, Music Folder and Movie Folder. So I come up with 3 questions:
What that User Selected File means? Is that means that the user can select some specific file for my app to access? If it is, how can user selects them?
How can I get access to other folders like Desktop Folder if I remain the App Sandbox capability here?
I also noticed the trash icon on right-upper corner. If I delete App Sandbox, I can access every folder I want with the user's agreement by a default system pop-up. But what the deletion of App Sandbox means? Does it make my app "untrusted" somehow when user install it or others? Does it cause any security problems?
And It couldn't be better if you can tell me the conventions major developers follow when meet this problem. I would highly appreciate your help.
I am running into a similar issue as described here: https://github.com/heremaps/here-ios-sdk-examples/issues/165
I used to have access to multiple voice packages however since I had to change my appId and key, I only have one voice package in the catalog. Below code was working until I had to change key. The user in the github issue had to contact here customer support to enable it.
let voiceCatalog = NMAVoiceCatalog.sharedInstance()
voiceCatalog?.delegate
// gets the list of packages
voiceCatalog?.update()
let spanishVoice = voiceCatalog?.voicePackage(withId: 204)
let englishVoice = voiceCatalog?.voicePackage(withId: 206)
// Since the spanish voice catalog does not exist anymore, this will crash the app.
print("check for spanish voice--", voiceCatalog?.installedVoicePackages.contains(spanishVoice!))
if(voiceCatalog?.installedVoicePackages.contains(spanishVoice!) == false){
print("do installation here")
voiceCatalog?.installVoicePackage(spanishVoice!)
}
In it's FAQ, WhatsApp explains how to create a new, prefilled message where the user can choose the contact to send the message to:
"To create a link with just a pre-filled message" from the FAQ Page here: https://faq.whatsapp.com/iphone/how-to-link-to-whatsapp-from-a-different-app
The link looks like this: https://wa.me/?text=I%27m%20inquiring%20about%20the%20apartment%20listing (example from the FAQ Page).
However, since a few days this seems not to work anymore on iOS and Desktop (Android Phones seems not to be affected yet).
The link with a phone number (https://wa.me/123456789?text=The%20message%20to%20send) is working just fine. The workaround with just adding "0" as the phone number doesn't work either as whatsApp will throw an error that the contact could not be found.
Has anyone else run into the same problem? And found a soution / workaround?
Your URL seems to be wrong. You need to append URL path which is /send in your URL string. You seem to be adding the URLQueries right after the base URL. Also, use addingPercentEncoding for encoding.
guard
let urlString = "whatsapp://send?text=\(text)"
.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed),
let unwrappedUrl = URL(string: urlString) else {
return nil
}
I send out Password reset links that are of the following format
https://example.com/login?email=123#456.com&tmpPas=qwertyuiopasdfghjkl
Some small percent of users are reporting that when they click the link the email and password parameters are not carried over to the website.
So far they have reported this issue on IE11 and Safari on Ipad. What could be causing this and what are the possible solutions to reduce the occurence.
I have been able to reproduce this on an Ipad mini each time. Even if i paste the URL in the browser it does trigger the reset flow. While from any other device it does work.
in the console logs i see this
SCRIPT5009: 'URLSearchParams' is not defined
Here is the relevant code
let url = new URL(window.location.href);
let searchParams = new URLSearchParams(url.search);
let emailAddress = (searchParams.get('email'));
let tempPass = (searchParams.get('tmpPass'));
Found that the URLSearchParams is not supported on all browsers. Found this code in this answer that did it https://stackoverflow.com/a/20097994