|
@@ -1,6 +1,5 @@
|
1
|
1
|
/*
|
2
|
|
- * Copyright @ 2018-present 8x8, Inc.
|
3
|
|
- * Copyright @ 2017-2018 Atlassian Pty Ltd
|
|
2
|
+ * Copyright @ 2017-present 8x8, Inc.
|
4
|
3
|
*
|
5
|
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -15,8 +14,6 @@
|
15
|
14
|
* limitations under the License.
|
16
|
15
|
*/
|
17
|
16
|
|
18
|
|
-#import <Availability.h>
|
19
|
|
-
|
20
|
17
|
@import CoreSpotlight;
|
21
|
18
|
@import MobileCoreServices;
|
22
|
19
|
@import Intents; // Needed for NSUserActivity suggestedInvocationPhrase
|
|
@@ -58,34 +55,29 @@
|
58
|
55
|
[self _onJitsiMeetViewDelegateEvent:@"CONFERENCE_JOINED" withData:data];
|
59
|
56
|
|
60
|
57
|
// Register a NSUserActivity for this conference so it can be invoked as a
|
61
|
|
- // Siri shortcut. This is only supported in iOS >= 12.
|
62
|
|
-#ifdef __IPHONE_12_0
|
63
|
|
- if (@available(iOS 12.0, *)) {
|
64
|
|
- NSUserActivity *userActivity
|
65
|
|
- = [[NSUserActivity alloc] initWithActivityType:JitsiMeetConferenceActivityType];
|
66
|
|
-
|
67
|
|
- NSString *urlStr = data[@"url"];
|
68
|
|
- NSURL *url = [NSURL URLWithString:urlStr];
|
69
|
|
- NSString *conference = [url.pathComponents lastObject];
|
70
|
|
-
|
71
|
|
- userActivity.title = [NSString stringWithFormat:@"Join %@", conference];
|
72
|
|
- userActivity.suggestedInvocationPhrase = @"Join my Jitsi meeting";
|
73
|
|
- userActivity.userInfo = @{@"url": urlStr};
|
74
|
|
- [userActivity setEligibleForSearch:YES];
|
75
|
|
- [userActivity setEligibleForPrediction:YES];
|
76
|
|
- [userActivity setPersistentIdentifier:urlStr];
|
77
|
|
-
|
78
|
|
- // Subtitle
|
79
|
|
- CSSearchableItemAttributeSet *attributes
|
80
|
|
- = [[CSSearchableItemAttributeSet alloc] initWithItemContentType:(NSString *)kUTTypeItem];
|
81
|
|
- attributes.contentDescription = urlStr;
|
82
|
|
- userActivity.contentAttributeSet = attributes;
|
83
|
|
-
|
84
|
|
- self.userActivity = userActivity;
|
85
|
|
- [userActivity becomeCurrent];
|
86
|
|
- }
|
87
|
|
-#endif
|
88
|
|
-
|
|
58
|
+ // Siri shortcut.
|
|
59
|
+ NSUserActivity *userActivity
|
|
60
|
+ = [[NSUserActivity alloc] initWithActivityType:JitsiMeetConferenceActivityType];
|
|
61
|
+
|
|
62
|
+ NSString *urlStr = data[@"url"];
|
|
63
|
+ NSURL *url = [NSURL URLWithString:urlStr];
|
|
64
|
+ NSString *conference = [url.pathComponents lastObject];
|
|
65
|
+
|
|
66
|
+ userActivity.title = [NSString stringWithFormat:@"Join %@", conference];
|
|
67
|
+ userActivity.suggestedInvocationPhrase = @"Join my Jitsi meeting";
|
|
68
|
+ userActivity.userInfo = @{@"url": urlStr};
|
|
69
|
+ [userActivity setEligibleForSearch:YES];
|
|
70
|
+ [userActivity setEligibleForPrediction:YES];
|
|
71
|
+ [userActivity setPersistentIdentifier:urlStr];
|
|
72
|
+
|
|
73
|
+ // Subtitle
|
|
74
|
+ CSSearchableItemAttributeSet *attributes
|
|
75
|
+ = [[CSSearchableItemAttributeSet alloc] initWithItemContentType:(NSString *)kUTTypeItem];
|
|
76
|
+ attributes.contentDescription = urlStr;
|
|
77
|
+ userActivity.contentAttributeSet = attributes;
|
|
78
|
+
|
|
79
|
+ self.userActivity = userActivity;
|
|
80
|
+ [userActivity becomeCurrent];
|
89
|
81
|
}
|
90
|
82
|
|
91
|
83
|
- (void)conferenceTerminated:(NSDictionary *)data {
|