I am trying to open Instagram when the user clicks a button. I don't see support from CodenameOne to open external applications so I created a native interface. However on iOS debug build it fails.
I literally copied the tutorial from the How Do I section and that worked fine but then I added the following two lines.
I think it might have to do with [UIApplication sharedApplication].
-(NSString*)sayHi:(int)param param1:(NSString*)param1 param2:(NSData*)param2{
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"instagram://user?username=joezoob"]]) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"instagram://user?username=joezoob"]];
}
return @"Hi";
}
Here is a snippit from the error log.
** BUILD FAILED **
The following build commands failed:
CompileC build/Main.build/Release-iphoneos/Main.build/Objects-normal/armv7/com_insideoutlier_theave_MyNativeImpl.o /var/folders/p7/d3z112yd0156kxkm2p21p8ym0000gn/T/build6983613762723567913xxx/build/xcode/src/app/com_insideoutlier_theave_MyNativeImpl.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Any ideas why this isn't working? Or another option for opening an external app on iOS using url schemes?