icefairy333 Active Member Licensed User Longtime User Jan 9, 2017 #1 Hi all, I'm wrapping an payment library ,the document says I need to implement openurl just like this: Code: @implementation UIApplication - (void)openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options completionHandler:(void (^)(BOOL))completion{ NSLog(@"openurlwith"); } @end how can I do it please?
Hi all, I'm wrapping an payment library ,the document says I need to implement openurl just like this: Code: @implementation UIApplication - (void)openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options completionHandler:(void (^)(BOOL))completion{ NSLog(@"openurlwith"); } @end how can I do it please?
Erel B4X founder Staff member Licensed User Longtime User Jan 9, 2017 #2 Are you supposed to override the built-in method: https://developer.apple.com/reference/uikit/uiapplication/1648685-openurl ? Why? Upvote 0
Are you supposed to override the built-in method: https://developer.apple.com/reference/uikit/uiapplication/1648685-openurl ? Why?
icefairy333 Active Member Licensed User Longtime User Jan 9, 2017 #3 to using:completionHandler I'm wrapping ping++ payment library from:https://www.pingxx.com It ask me to implement openurl,and this is his demo on github:https://github.com/PingPlusPlus/pingpp-ios/blob/master/example/demoapp/AppDelegate.m Upvote 0
to using:completionHandler I'm wrapping ping++ payment library from:https://www.pingxx.com It ask me to implement openurl,and this is his demo on github:https://github.com/PingPlusPlus/pingpp-ios/blob/master/example/demoapp/AppDelegate.m
Erel B4X founder Staff member Licensed User Longtime User Jan 9, 2017 #4 Add a method in your wrapper class that calls Pingpp handlerOpenURL:withCompletion: and call it from B4i: Code: Sub Application_OpenUrl (Url As String, Data As Object, SourceApplication As String) As Boolean Return Pingpp.HandleOpenUrl(Url) 'HandleOpenUrl is the wrapper method End Sub Upvote 0
Add a method in your wrapper class that calls Pingpp handlerOpenURL:withCompletion: and call it from B4i: Code: Sub Application_OpenUrl (Url As String, Data As Object, SourceApplication As String) As Boolean Return Pingpp.HandleOpenUrl(Url) 'HandleOpenUrl is the wrapper method End Sub
icefairy333 Active Member Licensed User Longtime User Jan 10, 2017 #5 I will try it thank you. Upvote 0