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!
Related
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 got an error,
The data couldn’t be read because it isn’t in the correct format.
Now I am making iPhone app by swift.
I added several codes to Info.plist of my app, I deleted these codes.
But when I wanna open Info.plist of my app, this error happen.I do not know why because I deleted all codes which I added.And I think format is really fixed.
My Info.plist is like
<?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>UILaunchStoryboardName</key>
<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>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>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
How can I fix this?
You've duplicated key in the info.plist file, remove the following key in the beginning
<key>UILaunchStoryboardName</key>
and it will resolve the issue.
Try something below:
Right click on Info.plist -> Source Code -> Discard Change
I was Building flutter project , and the problem was missing <string> for key io.flutter.embedded_views_preview adding <string></string> fixed my issue , i didn't update the info.plist though it was as created by flutter , hope this will help someone using flutter
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>
Since upgrading Xcode to v5 and converting launch and app icon images to image asset catalogs, I've been unable to see the Newsstand icon of my app in the Newsstand on iOS 6.1 and iOS 7. Instead I see the regular app icon in its place. I'm still compiling against iOS SDK 6.1 because of obvious style changes in iOS 7 that I haven't been able to test in depth, yet.
That said, here is what I've tried on my Newsstand icon, icon-newsstand.png:
Converting the icon-newsstand.png into an asset catalog located in ./Images.xcassets/icon-newsstand.imageset/icon-newsstand.png.
Keeping icon-newsstand.png in my Resources folder as a part of the project.
Neither of these solutions work. Here is my info.plist for reference also. I've redacted the app names, just FYI.
<?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>English</string>
<key>CFBundleDisplayName</key>
<string>---- ----</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIcons</key>
<dict>
<key>UINewsstandIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>icon-newsstand.png</string>
</array>
<key>UINewsstandBindingEdge</key>
<string>UINewsstandBindingEdgeLeft</string>
<key>UINewsstandBindingType</key>
<string>UINewsstandBindingTypeMagazine</string>
</dict>
</dict>
<key>UIBackgroundModes</key>
<array>
<string>newsstand-content</string>
</array>
<key>UINewsstandApp</key>
<true/>
<key>CFBundleIdentifier</key>
<string>com.----.----</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.1</string>
<key>CFBundleName</key>
<string>---- ----</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.0.1.13830</string> <!-- The Version of the app. -->
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIPrerenderedIcon</key>
<true/>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</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>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>FB Connect</string>
<key>CFBundleURLSchemes</key>
<array>
<string>fb150871295037449------</string><!-- The app id must be appended to the end of this string. Example: <string>fb150871295037449connections</string> -->
</array>
</dict>
</array>
</dict>
</plist>
Has anyone run into this yet after upgrading Xcode and converting to image asset catalogs? And does anyone have any ideas where to start with changes to my project? So far from my searches, details online and on StackOverflow have been sparse in terms of Newsstand and Xcode 5 issues.
I'd greatly appreciate any help. Thank you!
I found out that the issue was only happening with iPads. Since that discovery, I realized that there was a section missing from my info.plist that looks like this:
<key>CFBundleIcons~ipad</key>
<dict>
<key>UINewsstandIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>icon-newsstand.png</string>
</array>
<key>UINewsstandBindingEdge</key>
<string>UINewsstandBindingEdgeLeft</string>
<key>UINewsstandBindingType</key>
<string>UINewsstandBindingTypeMagazine</string>
</dict>
</dict>
Mystery solved!
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