[iOS] Unify openURL methods and mark the old one deprecated (#3489)

Make sure both methods offer the same behavior and mark the old one as
deprecated so SDK users get a warning.
This commit is contained in:
Saúl Ibarra Corretgé 2018-09-28 21:54:09 +02:00 committed by Любомир Маринов
parent 9a1e9fff98
commit c54db8337d
3 changed files with 14 additions and 13 deletions

View File

@ -154,6 +154,8 @@ or
} }
``` ```
NOTE: The latter is deprecated.
### JitsiMeetViewDelegate ### JitsiMeetViewDelegate
This delegate is optional, and can be set on the `JitsiMeetView` instance using This delegate is optional, and can be set on the `JitsiMeetView` instance using

View File

@ -46,7 +46,7 @@
+ (BOOL)application:(UIApplication * _Nonnull)application + (BOOL)application:(UIApplication * _Nonnull)application
openURL:(NSURL * _Nonnull)URL openURL:(NSURL * _Nonnull)URL
sourceApplication:(NSString * _Nullable)sourceApplication sourceApplication:(NSString * _Nullable)sourceApplication
annotation:(id _Nullable)annotation; annotation:(id _Nullable)annotation __deprecated;
- (void)loadURL:(NSURL * _Nullable)url; - (void)loadURL:(NSURL * _Nullable)url;

View File

@ -198,15 +198,10 @@ static NSMapTable<NSString *, JitsiMeetView *> *views;
+ (BOOL)application:(UIApplication *)app + (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
return if ([Dropbox application:app openURL:url options:options]) {
[Dropbox application:app openURL:url options:options] return YES;
|| [RCTLinkingManager application:app openURL:url options:options]; }
}
+ (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
// XXX At least twice we received bug reports about malfunctioning loadURL // XXX At least twice we received bug reports about malfunctioning loadURL
// in the Jitsi Meet SDK while the Jitsi Meet app seemed to functioning as // in the Jitsi Meet SDK while the Jitsi Meet app seemed to functioning as
// expected in our testing. But that was to be expected because the app does // expected in our testing. But that was to be expected because the app does
@ -216,10 +211,14 @@ static NSMapTable<NSString *, JitsiMeetView *> *views;
return YES; return YES;
} }
return [RCTLinkingManager application:application return [RCTLinkingManager application:app openURL:url options:options];
openURL:url }
sourceApplication:sourceApplication
annotation:annotation]; + (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
return [self application:application openURL:url options:@{}];
} }
#pragma mark Initializers #pragma mark Initializers