I'm making Facebook Login, I followed all the steps very well but Configuring my info.plist. My xml code is below:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb12345678</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>12345678</string>
<key>FacebookDisplayName</key>
<string>AppName</string>
I add this xml to the section of 'dict' at info.plist in my project not my projectTest.
So finally, I finished my .plist xml file
But I got an error
error: couldn't parse contents of '/Users/~/Desktop/app/app/myproject/Info.plist': The data couldn’t be read because it isn’t in the correct format.
How can I solve this?
UPDATE
Entire .plist is below :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.myproject.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
/*FACEBOOK XML IS JUST BELOW*/
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb12345678</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>12345678</string>
<key>FacebookDisplayName</key>
<string>AppName</string>
/**/
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
You are adding the snippet in wrong position:
<key>UIRequiredDeviceCapabilities</key> <<----- this one should go with
/*FACEBOOK XML IS JUST BELOW*/
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb12345678</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>12345678</string>
<key>FacebookDisplayName</key>
<string>AppName</string>
/**/
<array> << ------------- this one
<string>armv7</string>
</array>
Add fb snippet before
<key>UIRequiredDeviceCapabilities</key>
or after
<array> << ------------- this one
<string>armv7</string>
</array>
Related
i've configured this Info.plist for google and then facebook for signing in with social.
The problem when added facebook it works but google sign in not working. The console debugger it 'Your app is missing support for the following URL schemes: com.googleusercontent.apps.************************'
Here is my configuration Info.plist file content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.**********************</string>
</array>
</dict>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<!-- facebook -->
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb*************</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>***************</string>
<key>FacebookClientToken</key>
<string>****************</string>
<key>FacebookDisplayName</key>
<string>Nome app</string>
<!--Per usare una delle finestre di dialogo di Facebook (ad es. Accedi, Condividi, inviti a installare l'app ecc.) che consentono di eseguire il passaggio di un'app alle app Facebook-->
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-share-api</string>
</array>
</dict>
</plist>
Thanks for any appreciated help. I need for this morning please.
I had the similar issue but instead of google I had vk.
Still the solution is the same.
Initial code
<!-- VK Configuration -->
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>vk12345</string>
</array>
</dict>
</array>
<!-- -->
<key>LSApplicationQueriesSchemes</key>
<array>
<string>vk</string>
<string>vk-share</string>
<string>vkauthorize</string>
</array>
<!-- -->
<key>VKAppId</key>
<string>{YOUR_VK_ID}</string>
<!-- Facebook Config -->
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb{YOUR_FB_ID}</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>{YOUR_FB_ID}</string>
<key>FacebookClientToken</key>
<string>{YOUR_FB_TOKEN}</string>
<key>FacebookDisplayName</key>
<string>{YOUR_FB_NAME}</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-share-api</string>
</array>
<!-- -->
Merged code
<!-- MERGED -->
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>vk{YOUR_VK_ID}</string>
<string>fb{YOUR_FB_ID}</string>
</array>
</dict>
</array>
<!-- MERGED -->
<key>LSApplicationQueriesSchemes</key>
<array>
<string>vk</string>
<string>vk-share</string>
<string>vkauthorize</string>
<string>fbapi</string>
<string>fb-messenger-share-api</string>
</array>
<key>VKAppId</key>
<string>{YOUR_VK_ID}</string>
<!-- Facebook Config -->
<key>FacebookAppID</key>
<string>{YOUR_FB_ID}</string>
<key>FacebookClientToken</key>
<string>{YOUR_FB_TOKEN}</string>
<key>FacebookDisplayName</key>
<string>Katharsis</string>
<!-- -->
I try to use Snapchat's Login Kit. But it doesn't redirect to my app after authentication.
I used this Login Kit before which is still working now. So I also compared both info.plist which are identical except for "SCSDKClientId", "SCSDKRedirectUrl" and "CFBundleURLSchemes"
Here's my info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>MY_APP_NAME</string>
</array>
</dict>
</array>
<key>SCSDKClientId</key>
<string>MY_SCSDK_CLIENT_ID</string>
<key>SCSDKRedirectUrl</key>
<string>MY_APP_NAME://snap-kit/oauth2</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>itms-apps</string>
<string>snapchat</string>
<string>bitmoji-sdk</string>
</array>
<key>SCSDKScopes</key>
<array>
<string>https://auth.snapchat.com/oauth2/api/user.bitmoji.avatar</string>
</array>
</dict>
</plist>
I make sure that the SCSDKRedirectUrl is the same as the developer portal one
The following function gets called.
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
if SCSDKLoginClient.application(app, open: url, options: options) {return true}
return false
}
But SCSDKLoginClient.application(app, open: url, options: options) returns false all the time.
I'm out of ideas why this happens now. Any thoughts will be appreciated.
Update: I missed the SceneDelegate part for ios13. The solution can be find here: SnapKit fails return to app after logging into Snapchat
I have been struggling with this problem for some time now and I wish that the Snap Kit Documentation would provide more insight on this. Essentially, you may have not set up your URL Schemes. This actually isn't a Snap Chat problem but a p.list problem. You can check if your app allows redirects using safari. Here is the article I read, good luck!
https://kitefaster.com/2016/07/13/how-to-open-ios-app-with-custom-url/
I have read this: open text files with my ios app and it's great in the fact that it allows me to see my app as one of the options to open it with and when selecting my app it opens my app but that's it. There are two problems:
First of all, while "opening with" for example Google drive says "Copy to Drive", while mine says "Copy to (null)" when I want it to say "Copy to HotSpotRIS". How can I do this? At least the app icon shows up. If it helps, my overall bundle identifier for my entire project is www.epicode.com.HotSpotRIS. Here are three pictures showing you what I am specifically talking about where the first picture is showing you the emailed txt, second is the user holding down on the txt file, and the third is the "open with" menu that pops up from this with my app reading "Copy to (null)":
Second of all, I know how to read and write text files and how to navigate the iOS file system but how do I connect my code to the .plist file in order to read the emailed txt file? I am guessing there needs to be some identifier that I can then use to call to obtain the txt data. Here is my info.plist file so far with the last bit of the file being the code I got from open text files with my ios app:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleGetInfoString</key>
<string></string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>NSLocationWhenInUseUsage</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>CFBundleDisplayName</key>
<string></string>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Text File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>txt</string>
<string>TXT</string>
</array>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSItemContentTypes</key>
<array>
<string>www.epicode.com.HotSpotRIS.txt</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.text</string>
</array>
<key>UTTypeDescription</key>
<string>Plain Text Document</string>
<key>UTTypeIdentifier</key>
<string>www.epicode.com.HotSpotRIS.txt</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>txt</string>
<key>public.mime-type</key>
<string>text/plain</string>
</dict>
</dict>
</array>
</dict>
</plist>
Thank you in advance!
When I try to publish my app to the App Store I get an error which says:
This bundle is invalid. An unknown device capability value is supplied
in the UIRequiredDeviceCapabilities key of the Info.plist. Make
certain that the value for UIRequiredDeviceCapabilities is an array or
a dictionary, containing valid values as described in the Information
Property List Key Reference.
Can someone help me to fix this?
Plist looks like this:
http://j.mp/V2B8lk
Plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>AppName</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFiles</key>
<array>
<string>114.png</string>
<string>icon.png</string>
</array>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>114.png</string>
<string>icon.png</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
</dict>
<key>CFBundleIdentifier</key>
<string>company.appname</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIPrerenderedIcon</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<false/>
<key>UIStatusBarTintParameters</key>
<dict>
<key>UINavigationBar</key>
<dict>
<key>Style</key>
<string>UIBarStyleDefault</string>
<key>Translucent</key>
<false/>
</dict>
</dict>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</dict>
</plist>
The Required device capabilities shouldn't be a Boolean. It's supposed to be an array or a dictionary.
I don't know whether you can fix it in the plist editor. If not, you can open the file in a text editor and change it like this:
<key>UIRequiredDeviceCapabilities</key>
<array></array>
Update
It's probably best to delete the entry Required device capabilities if you don't use it.
I've been developing an app for android and iphone, and been able to implement sso on android but when I try to implement it on iOS I get the above mentioned error :
"Safari cannot open the page because the address is invalid"
The error is shown after I click "okay" to give the permissions to my personal information on facebook to the app
the link in question is : m.facebook.com/dialog/oauth?refid=0
here is my info.plist file
<plist version="1.0">
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>icon.png</string>
<string>icon#2x.png</string>
<string>icon-72.png</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>icon.png</string>
<key>CFBundleIdentifier</key>
<string>com.snizilica.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
<string></string>
<key>NSMainNibFile~ipad</key>
<string></string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>[com.facebook.test]</string>
<key>CFBundleURLSchemes</key>
<array>
<string>fb[xxxxxxxxxxxxxxx]</string>
</array>
</dict>
</array>
where xxxxxxxxxxx is my app_id
Had the same problem. Solved it having removed the square brackets in the app id
...rfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb123456789012345</string>
</array>
</dict>
</array>
</dict>
</plist>
dont use any square bracets around the app id