File tree 4 files changed +502
-0
lines changed
4 files changed +502
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ internal enum InfoPlist {
35
35
internal static let nsMicrophoneUsageDescription : String = _document [ " NSMicrophoneUsageDescription " ]
36
36
internal static let nsPhotoLibraryUsageDescription : String = _document [ " NSPhotoLibraryUsageDescription " ]
37
37
internal static let nsSiriUsageDescription : String = _document [ " NSSiriUsageDescription " ]
38
+ internal static let nsUserActivityTypes : [ String ] = _document [ " NSUserActivityTypes " ]
38
39
internal static let uiBackgroundModes : [ String ] = _document [ " UIBackgroundModes " ]
39
40
internal static let uiLaunchStoryboardName : String = _document [ " UILaunchStoryboardName " ]
40
41
internal static let uiRequiredDeviceCapabilities : [ String ] = _document [ " UIRequiredDeviceCapabilities " ]
Original file line number Diff line number Diff line change @@ -748,6 +748,26 @@ - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserAct
748
748
{
749
749
continueUserActivity = [self handleUniversalLink: userActivity];
750
750
}
751
+ else if ([userActivity.activityType isEqualToString: INSendMessageIntentIdentifier])
752
+ {
753
+ INInteraction *interaction = userActivity.interaction ;
754
+ if (interaction && [interaction.intent isKindOfClass: [INSendMessageIntent class ]])
755
+ {
756
+ INSendMessageIntent *intent = (INSendMessageIntent *)(interaction.intent );
757
+ INPerson *person = intent.recipients .firstObject ;
758
+ if (person && person.customIdentifier ) {
759
+ NSString *identifier = person.customIdentifier ;
760
+
761
+ [self startDirectChatWithUserId: identifier completion: NULL ];
762
+ // TODO: initialize text if from a siri shortcut
763
+ continueUserActivity = YES ;
764
+ } else {
765
+ MXLogWarning (@" A recipient was missing in the INSendMessageIntent" );
766
+ }
767
+ } else {
768
+ MXLogWarning (@" How can an INSendMessageIntent activity not have an INSendMessageIntent?" );
769
+ }
770
+ }
751
771
else if ([userActivity.activityType isEqualToString: INStartAudioCallIntentIdentifier] ||
752
772
[userActivity.activityType isEqualToString: INStartVideoCallIntentIdentifier])
753
773
{
Original file line number Diff line number Diff line change 65
65
<string >The photo library is used to send photos and videos. </string >
66
66
<key >NSSiriUsageDescription </key >
67
67
<string >Siri is used to perform calls even from the lock screen. </string >
68
+ <key >NSUserActivityTypes </key >
69
+ <array >
70
+ <string >INSendMessageIntent </string >
71
+ <string >INStartAudioCallIntent </string >
72
+ <string >INStartVideoCallIntent </string >
73
+ </array >
68
74
<key >UIBackgroundModes </key >
69
75
<array >
70
76
<string >audio </string >
You can’t perform that action at this time.
0 commit comments