LSApplicationQueriesSchemes and derived data
You have made the LSApplicationQueriesSchemes a dict
, it must be an array, like this, then it will work :).
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
</array>
And I would also recommend you to not unwrap the optional URL using !
, you can do it like this instead:
guard
let whatsAppUrl = URL(string: "whatsapp://send?text=Hello%2C%20World!"),
case let application = UIApplication.shared,
application.canOpenURL(whatsAppUrl)
else { return }
application.openURL(whatsAppUrl)
InvalidOperationException', reason: 'fbauth2 is missing from your Info.plist under LSApplicationQueriesSchemes and is required for iOS 9.0'
remove the space after fbauth2
FBSDK Login Error Code: 308 in Objective-C
One solution, at least for me, is to not run on device via the Xcode debugger. If I run the app on device outside the debugger the Facebook login works fine. If I run the app in the sim via the debugger the Facebook login works fine.
Only if I run the app on device via the Xcode debugger do I get the com.facebook.sdk.login error 308 every time.
How to share an image on Instagram in iOS?
Finally I got the answer. you can not directly post an image on instagram. You have to rediredt your image with UIDocumentInteractionController.
@property (nonatomic, retain) UIDocumentInteractionController *dic;
CGRect rect = CGRectMake(0 ,0 , 0, 0);
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, self.view.opaque, 0.0);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIGraphicsEndImageContext();
NSString *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/test.igo"];
NSURL *igImageHookFile = [[NSURL alloc] initWithString:[[NSString alloc] initWithFormat:@"file://%@", jpgPath]];
self.dic.UTI = @"com.instagram.photo";
self.dic = [self setupControllerWithURL:igImageHookFile usingDelegate:self];
self.dic=[UIDocumentInteractionController interactionControllerWithURL:igImageHookFile];
[self.dic presentOpenInMenuFromRect: rect inView: self.view animated: YES ];
- (UIDocumentInteractionController *) setupControllerWithURL: (NSURL*) fileURL usingDelegate: (id <UIDocumentInteractionControllerDelegate>) interactionDelegate {
UIDocumentInteractionController *interactionController = [UIDocumentInteractionController interactionControllerWithURL: fileURL];
interactionController.delegate = interactionDelegate;
return interactionController;
}
NOTE : once you redirect to instagram app you can not back to your app. you have to open your app again
Download source from here
Displaying a JComponent inside a JPanel on a JFrame
A JPanel
's default layout is a FlowLayout
so you don't have to specify the center of the panel.
Simply do:
panel.add(component);
Alternately, do:
panel.setLayout(new BorderLayout());
panel.add(component, BorderLayout.CENTER);
Related Topics
Difference Between @Propertydelegate and @Propertywrapper
Convert from Nsdictionary to [String:Any]
Swift - Measurement Convert(To:) Miles to Feet Gives Wrong Result
Reading from Txt File in Swift 3
Why Is Swift Counting This Grapheme Cluster as Two Characters Instead of One
Why Do I Get Source Kit Service Terminated Error
How to Set First Responder for Nstextview in Swift
Localizing The Reading of Emoji on iOS 10.0 or Higher
Enum of String Type Vs Struct with Static Constant
iOS Swift, Aws Cognito User Pool, Unable to Refresh Access Token
Produce Sounds of Different Frequencies in Swift
Iterating Through an Array of Strings, Fetched from Mongodb
Where Do I Register a Valuetransformer in Swift
Uidatepicker Show Only Sunday's Date Only
In Swift 5, What Is a Way to Compare Pointers to Two Closures
Is There a Way in Swiftui to Detect If a User Has Larger Text Size Enabled