afnvision:// URL Scheme - ios

iOS application is calling following error:
-canOpenURL: failed for URL: "afnvision://" - error: "This app is not allowed to query for scheme afnvision"
I have looked LSApplicationQueriesSchemes and all calls to canOpenURL , but can't find such a url scheme any where. I have not added this url scheme in my app.
I feel appsFlyer is calling this. Because I get two logs
[1669:49374] AppsFlyer SDK version 2.5.3.16 started
[1669:49374] -canOpenURL: failed for URL: "afnvision://" - error: "This app is not allowed to query for scheme afnvision"
Anyway I can stop this or know which all URL schemes my app calls when it is on App store.

In you info.plist file, add afnvision under LSApplicationQueriesSchemes as shown in the screenshot below:

Related

Calling external application from IOS 9 webview with Nativescript

I'm trying to open external application from webview on IOS 9 and I keep getting this error.
ispmobile://param?TID=enter_your_id
-canOpenURL: failed for URL: "ispmobile://param?TID=enter_your_id" - error:
"This app is not allowed to query for scheme ispmobile"
When I looked around, apparently there is a restriction from IOS 9 and on when calling external app and the solution that I was pointed to was to implement LSApplicationQueriesSchemes in the info.plist.
info.plist
<key>LSApplicationQueriesSchemes</key>
<string>ispmobile://</string>
I have done that and i still get the "This app is not allowed to query for scheme ispmobile" error
Any suggestions on how to fix this?
thanks in advance

canOpenURL, problems adding site to whitelist

I am currently updating an app and using Xcode 7.3. The app utilizes iAd banner ads and Flurry interstitial ads. When the iAd banner goes to load I get the error.
-canOpenURL: failed for URL: "about:blank" - error: "This app is not allowed to query for scheme about"
The banner loads just fine, and everything works as planned.
In researching this I found the method was deprecated for privacy reasons. However, I can not even find it in any of my files. Also, I have read about adding sites to a whitelist with LSApplicaitonQueriesSchemes. I did this in my plist with the following strings in the array;
about:blank
about
blank
The error then reads;
-canOpenURL: failed for URL: "about:blank" - error: "(null)"
I can't seem to get rid of the error no matter what I do. Does anyone have any ideas of what to do? I see a lot of info for urls that go to social media apps and such, but not for the about:blank url. Thanks in advance.
You only need to whitelist about since that is the scheme being accessed.
The message -canOpenURL: failed for URL: "about:blank" - error: "(null)" means you have everything working. iOS logs that informational message when an app tries to call canOpenURL: for a whitelisted scheme but there is no app installed that supports the given scheme. It's a confusing debug message from iOS that can be safely ignored.

Why so many canOpenURL?

When running AlipaySDK demo from https://doc.open.alipay.com/doc2/detail?treeId=54&articleId=103419&docType=1, some odd things happened.
From the log output in xcode, there are more than 10 logs to say
-canOpenURL: failed for URL: "momochs://" - error: "This app is not allowed to query for scheme momochs
There are no source code in demo to print out such things by simple searching. And the static lib just does payment and shouldn't do such checking according to my understanding.
Question here is to figure out why this happened or something wrong for the demo or other setup ?
2016-03-02 15:58:55.998 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "momochs://" - error: "This app is not allowed to query for scheme momochs"
2016-03-02 15:58:55.999 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "tenpay://" - error: "This app is not allowed to query for scheme tenpay"
2016-03-02 15:58:55.999 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "com.icbc.iphoneclient://" - error: "This app is not allowed to query for scheme com.icbc.iphoneclient"
2016-03-02 15:58:56.000 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "wx2654d9155d70a468://" - error: "This app is not allowed to query for scheme wx2654d9155d70a468"
2016-03-02 15:58:56.000 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "meituan0000://" - error: "This app is not allowed to query for scheme meituan0000"
2016-03-02 15:58:56.000 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "sinaweibo://" - error: "This app is not allowed to query for scheme sinaweibo"
2016-03-02 15:58:56.001 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "dianping://" - error: "This app is not allowed to query for scheme dianping"
2016-03-02 15:58:56.001 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "diditaxi://" - error: "This app is not allowed to query for scheme diditaxi"
2016-03-02 15:58:56.002 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "cn.12306://" - error: "This app is not allowed to query for scheme cn.12306"
2016-03-02 15:58:56.002 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "mtxx://" - error: "This app is not allowed to query for scheme mtxx"
2016-03-02 15:58:56.002 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "youku://" - error: "This app is not allowed to query for scheme youku"
2016-03-02 15:58:56.003 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "baidumap://" - error: "This app is not allowed to query for scheme baidumap"
2016-03-02 15:58:56.003 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "iosamap://" - error: "This app is not allowed to query for scheme iosamap"
Why so many canOpenURL ?
Because they want to know which apps are installed, up to iOS8 this was an ugly trick to know which apps you have installed, they basically have a list of app schemes they want to know about, so they will do consecutive canOpenURL calls for each app scheme, then harvest the data and send it back to their servers for whatever purpose they need it to.
Thankfully this is no longer allowed in iOS9, since you need to provide the list of schemes your app will do canOpenURL calls against, calling an url scheme that's not in your info.plist will result in that log warning you see
The odd thing is I got log information as below, but can't find any
source code to print out such things.
The SDK isn't open sourced from what I see, so there's no way for you to peek into their code, the code is inside the static libs *.a files
Just wonder how can they do this without source code ? Any technology to >achieve this ? thanks
It's nothing special, if you write a project and build it as a static library you'll get the compiled source in .a files, that you can import to other projects and use there, as long as you have the proper header files, this is exactly how AliPay does it
Hope this clears up the confusion, I recommend to leave it as is, don't allow them to pull off stunts like that.
You can always add the list of those schemes into your info.plist, but then you'll have to explain to apple yourself why you need to open so many apps, again, very bad idea, simply ignore it and you're good to go!

Login error in iOS 9 Facebook SDK

I've seen many questions on StackOverflow about this problem, but none solved my issue.
I've created a sample app containing only the FB login button, followed the Facebook iOS 9 setup documentation, inserted ATS configs in info.plist and tried to run.
Everything works on iOS Simulator (I'm running XCode 7.1) except for a warning, but i wasn't very concerned because Facebook docs days it can be ignored.
This is the warning tho
-canOpenURL: failed for URL: "fbauth2:/" - error: "(null)"
Login works fine, and returns to the MainViewController logged in.
Problem occurs when i try to run it on device (iPhone 5, iOS 9.0.2)...
View switches to safari but after loggin in and confirming permissions, Safari fails to redirect back to the app, and says the address is invalid.
What is wrong with my application? Is there something i didn't consider?
Thanks in advance.
IOS 9 URL Shchemes Update : iOS 9 introduces LSApplicationQueriesSchemes to allow apps to query if other apps are installed.
1- If a url scheme is declared and calling canOpenURL(scheme)
YES if a installed app supports that URL scheme
NO if no app supporting that url
syslog will show canOpenURL: failed for URL: "urlScheme://" - error: null
2- If a url scheme is not declared and calling canOpenURL(scheme)
always return NO
syslog will show canOpenURL: failed for URL: "urlScheme://" - error: null
In iOS 9, the developer must add these info.plist LSApplicationQueriesSchemes
<array>
<string>urlscheme</string>
<string>urlscheme2</string>
<string>urlscheme3</string>
<string>urlscheme4</string>
</array>

canOpenUrl fail "org-appextension-feature-password-management" (PayPal)

PayPal payment not working as I get failure on opening a URL
-canOpenURL: failed for URL: "org-appextension-feature-password-management://" - error: "(null)"
In accordance with the documentation I added org-appextension-feature-password-management to my info.plist, but I still get the below error.
Ideas what I might have overlooked?
Seems to be a bug in PayPal SDK.
The error only occurs in the PayPalEnvironmentNoNetwork setting. When you switch over to PayPalEnvironmentSandbox or PayPalEnvironmentProduction the error does not persist (assuming you have set LSApplicationQueriesSchemes correctly).

Resources