I am implementing a React Native app with an in-app browsers using react-native-inappbrowser-reborn. The website I am trying to browse needs accesses to camera and mic of the users' computer. Normally, there would be a pop-up asking for user permissions. However, in IOS, the pop-up does not appear. It just does not appear and there isn't any errors. However, it works well in Android phones.
So, my question is whether I install it wrongly or this library does not handle that use-case at all?
Thank you guys.
Here is my Info.plist file:
<?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>WebviewDemo</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>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSCameraUsageDescription</key>
<string>Camera Permission</string>
<key>NSMicrophoneUsageDescription</key>
<string>Microphone Permission</string>
</dict>
</plist>
Related
this is my WebView
<WebView x:Name="webview" Source="http://google.com" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" HeightRequest="500" >
</WebView>
it's show on Android but not on ios,i also added
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
to info.plist iOS but it dosen't work!what's problem?
Try these:
Use https:// instead of http.
give width too to the webview.
Above two should help, but even if above solutions doesn't work.try adding like this in info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>google.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
...
I am trying to open YouTube's app from my application with the URL scheme or the YouTube.com domain which opens YouTube's app directly on an iOS device.
This is the code I tried:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"youtube://results?search_query=trailer+%#",movieTitle]]];
and
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"https://www.youtube.com/results?search_query=trailer+%#",movieTitle]]];
But nothing seems to work. Any ideas on how to retrieve the URL scheme for YouTube's tvOS application?
On Apple TV you can use this URL scheme to play a YouTube video in the YouTube app:
youtube://watch/video_id
Code example:
func playVideoInYouTube(_ identifier: String) {
if let url = URL(string: "youtube://watch/" + identifier),
UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
else {
// Inform the user about missing YouTube app
}
}
To use the canOpenURL method, you have to add the scheme to the Info.plist file under key LSApplicationQueriesSchemes, as part of a schemes array. In XML it looks like this:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>youtube</string>
</array>
Not necessarily positing this as a “correct" answer, but I think all YouTube links, on iOS at least, are handled by http, not something like youtube://.
Source (looks to be from June 2015):
https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/YouTubeLinks/YouTubeLinks.html
I also encountered some issues playing youtube videos in the youtube app but I found a workaround, I used the XCDYouTubeKit library to play the youtube video's directly in my app. It's very easy to use and works fine so far.
XCDYouTubeKit : https://github.com/0xced/XCDYouTubeKit
I'm trying to get images sent to instagram in my app, like many photo apps are doing these days. I followed some tutorials on importing document from UIDocumentInteractionController, but it's not working.
Maybe because all tutorials are on how to open PDF files, and to open the .ig files that are sent to instagram I need something more?
Anyway, I edited my plist to add the following lines:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>LSItemContentTypes</key>
<array>
<string>com.instagram.photo</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleTypeName</key>
<string>Ig Document</string>
<key>LSHandlerRank</key>
<string>Default</string>
</dict>
</array>
And now my app appears in the UIDocumentInteractionController menu, but when I click on "Open in MyPhotoApp", the menu just closes, and nothing happens.
I'm tried putting a break point in the method: (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
But it appears that it's never called. What am I missing?
Ok, figured out. I was missing the following lines on my plist:
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>ig</string>
</dict>
<key>UTTypeIdentifier</key>
<string>com.instagram.photo</string>
<key>UTTypeDescription</key>
<string>Ig Photo</string>
</dict>
</array>
Now it's working
I had an iPad app that supports two Orientation I set Supported interface orientations on info.plist to Landscape (right home button) and Landscape (left home button). I also set Initial interface orientation to Landscape (right home button).
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
}
When I receive push notification and my app is closed. And I started the app not from notification. The notification banner appears up-side down. This happens only when I'm holding ipad on Landscape (left home button). Is there something I'm missing? Any help would be appreciated. Thanks in advance,
I am also facing same issue and tried many ways;
In my app I require only landscape orientation so I set
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
in shouldAutorotateToInterfaceOrientation of every ViewController
and in info.plist for supported interface orientation I am setting
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
This solved my problem.
I'm trying to create a drag and drop region that accepts any file type and will upload it to a server (using ASIHTTPRequest). I looked at the following example that Apple provides:
http://developer.apple.com/library/mac/#samplecode/CocoaDragAndDrop/Introduction/Intro.html
but it only covers dealing with the dragging and dropping of images. How can I set up my drag and drop operations to deal with any file type?
Thanks.
Kind of related, but adding this in case it's helpful for someone:
If you simply want to handle any file dragged onto the application icon (doesn't need to be an Document-based app):
In .h:
- (void)application:(NSApplication *)sender openFiles:(NSArray *) fileNames;
In .m:
- (void)application:(NSApplication *)sender openFiles:(NSArray *) fileNames {
NSLog(#"Files dragged on: %#", fileNames);
}
In your xxx.plist, create a new entry under CFBundleDocumentTypes:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeName</key>
<string>NSFilenamesPboardType</string>
<key>CFBundleTypeRole</key>
<string>None</string>
</dict>
</array>
Judging by this post, you'd probably just have to have your view register for NSFilenamesPboardType instead of the imagePastBoardTypes to receive arbitrary file types.