Lsapplicationqueriesschemes and Derived Data

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



Leave a reply



Submit