diff --git a/CHANGES.rst b/CHANGES.rst index 492903ce7..2c72c1345 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,20 @@ +Changes in 0.5.3 (2017-08-25) +=============================================== + +Improvements: + * Upgrade MatrixKit version (v0.6.2). + * Support dark theme (vector-im/riot-meta#22). + * Set the application group identifier to be able to share userDefaults object. + +Bug Fixes: + * SettingsViewController: Release correctly the pushed view controller. + * App have crashed whilst uploading photos (#1445). + * Register for remote notifications only if user provides access to notification feature, thanks to @aramsargsyan (#1467). + * Improvements in notification registration flow, thanks to @aramsargsyan (#1472). + +Translations: + * Enable Russian. + Changes in 0.5.2 (2017-08-01) =============================================== diff --git a/Podfile b/Podfile index ba5a9c5e6..39eeec830 100644 --- a/Podfile +++ b/Podfile @@ -8,7 +8,7 @@ target "Riot" do # Different flavours of pods to MatrixKit # The tagged version on which this version of Riot has been built -pod 'MatrixKit', '0.6.1' +pod 'MatrixKit', '0.6.2' # The lastest release available on the CocoaPods repository #pod 'MatrixKit' @@ -52,8 +52,8 @@ pod 'OLMKit' #pod 'OLMKit', :path => '../olm/OLMKit.podspec' pod 'Realm', '~> 2.8.1' -# The tagged version on which this version of Riot has been built -pod 'MatrixKit', '0.6.1' +# The tagged version on which this version of Riot share extension has been built +pod 'MatrixKit/AppExtension', '0.6.2' # The lastest release available on the CocoaPods repository #pod 'MatrixKit/AppExtension' @@ -70,7 +70,6 @@ pod 'MatrixKit', '0.6.1' # Remove warnings from "bad" pods pod 'OLMKit', :inhibit_warnings => true pod 'cmark', :inhibit_warnings => true -pod 'DTCoreText', :inhibit_warnings => true end diff --git a/Podfile.lock b/Podfile.lock index 3e0d6acf9..7264c3ab8 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -26,6 +26,11 @@ PODS: - DTFoundation/DTAnimatedGIF (~> 1.7.5) - DTFoundation/DTHTMLParser (~> 1.7.5) - DTFoundation/UIKit (~> 1.7.5) + - DTCoreText/Extension (1.6.20): + - DTFoundation/Core (~> 1.7.5) + - DTFoundation/DTAnimatedGIF (~> 1.7.5) + - DTFoundation/DTHTMLParser (~> 1.7.5) + - DTFoundation/UIKit (~> 1.7.5) - DTFoundation/Core (1.7.12) - DTFoundation/DTAnimatedGIF (1.7.12) - DTFoundation/DTHTMLParser (1.7.12): @@ -39,13 +44,27 @@ PODS: - GZIP (1.1.1) - HPGrowingTextView (1.1) - libPhoneNumber-iOS (0.9.10) - - MatrixKit (0.6.1): + - MatrixKit (0.6.2): - cmark (~> 0.24.1) - DTCoreText (~> 1.6.17) - HPGrowingTextView (~> 1.1) - libPhoneNumber-iOS (~> 0.9.10) - - MatrixSDK (= 0.9.1) - - MatrixSDK (0.9.1): + - MatrixKit/Core (= 0.6.2) + - MatrixSDK (= 0.9.2) + - MatrixKit/AppExtension (0.6.2): + - cmark (~> 0.24.1) + - DTCoreText (~> 1.6.17) + - DTCoreText/Extension + - HPGrowingTextView (~> 1.1) + - libPhoneNumber-iOS (~> 0.9.10) + - MatrixSDK (= 0.9.2) + - MatrixKit/Core (0.6.2): + - cmark (~> 0.24.1) + - DTCoreText (~> 1.6.17) + - HPGrowingTextView (~> 1.1) + - libPhoneNumber-iOS (~> 0.9.10) + - MatrixSDK (= 0.9.2) + - MatrixSDK (0.9.2): - AFNetworking (~> 3.1.0) - GZIP (~> 1.1.1) - OLMKit (2.2.2): @@ -63,7 +82,8 @@ DEPENDENCIES: - DTCoreText - GBDeviceInfo (~> 4.3.0) - GoogleAnalytics - - MatrixKit (= 0.6.1) + - MatrixKit (= 0.6.2) + - MatrixKit/AppExtension (= 0.6.2) - OLMKit - Realm (~> 2.8.1) - WebRTC (= 58.17.16937) @@ -78,12 +98,12 @@ SPEC CHECKSUMS: GZIP: f8beb59597f651e6970a45b816508a9c6d700b77 HPGrowingTextView: 88a716d97fb853bcb08a4a08e4727da17efc9b19 libPhoneNumber-iOS: f721ae4d5854bce60934f9fb9b0b28e8e68913cb - MatrixKit: fbf30823fb64604b5f8bb8ef8cbb8d949189525b - MatrixSDK: c5d9b84da5e32b305c5def410f239a7d94c72105 + MatrixKit: 8552ee8abf935b08ae08fc0000f53ab3218ea5a0 + MatrixSDK: 0499dd3dbe293ce1e743a7cda181dcf50eda7f10 OLMKit: b9d8c0ffee9ea8c45bc0aaa9afb47f93fba7efbd Realm: 3601ef091c8c499a31101d8563b991e75546cdce WebRTC: 1e9a85bf75509eec44be6478c64e9de65ac82332 -PODFILE CHECKSUM: 76ecd40dee0ff2c3007141b353b385be7e863d6c +PODFILE CHECKSUM: db0ae7d6037f7768feb2adf17119ba69d9e1a77b -COCOAPODS: 1.2.1 +COCOAPODS: 1.3.1 diff --git a/Riot.xcodeproj/project.pbxproj b/Riot.xcodeproj/project.pbxproj index 7f4d1ddbc..6c62b7916 100644 --- a/Riot.xcodeproj/project.pbxproj +++ b/Riot.xcodeproj/project.pbxproj @@ -2866,68 +2866,68 @@ ); inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-Riot/Pods-Riot-resources.sh", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Controllers/MXKAccountDetailsViewController.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Controllers/MXKAttachmentsViewController.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Controllers/MXKAuthenticationViewController.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Controllers/MXKCallViewController.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Controllers/MXKContactDetailsViewController.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Controllers/MXKContactListViewController.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Controllers/MXKCountryPickerViewController.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Controllers/MXKLanguagePickerViewController.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Controllers/MXKRecentListViewController.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Controllers/MXKRoomMemberDetailsViewController.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Controllers/MXKRoomMemberListViewController.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Controllers/MXKRoomSettingsViewController.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Controllers/MXKRoomViewController.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Controllers/MXKSearchViewController.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/Account/MXKAccountTableViewCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/Authentication/MXKAuthInputsEmailCodeBasedView.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/Authentication/MXKAuthInputsPasswordBasedView.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/Contact/MXKContactTableCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/DeviceView/MXKDeviceView.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/EncryptionInfoView/MXKEncryptionInfoView.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKCollectionViewCell/MXKMediaCollectionViewCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKEventDetailsView.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKPieChartHUD.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKRoomCreationView.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithButton.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndButton.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndImageView.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndMXKImageView.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndSlider.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndSubLabel.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndSwitch.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndTextField.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelTextFieldAndButton.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithPicker.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithSearchBar.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithTextFieldAndButton.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithTextView.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/PushRule/MXKPushRuleCreationTableViewCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/PushRule/MXKPushRuleTableViewCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/ReadReceipts/MXKReadReceiptTableViewCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomBubbleList/MXKRoomEmptyBubbleTableViewCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomBubbleList/MXKRoomIncomingAttachmentBubbleCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomBubbleList/MXKRoomIncomingAttachmentWithoutSenderInfoBubbleCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomBubbleList/MXKRoomIncomingTextMsgBubbleCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomBubbleList/MXKRoomIncomingTextMsgWithoutSenderInfoBubbleCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomBubbleList/MXKRoomIOSOutgoingBubbleTableViewCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomBubbleList/MXKRoomOutgoingAttachmentBubbleCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomBubbleList/MXKRoomOutgoingAttachmentWithoutSenderInfoBubbleCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomBubbleList/MXKRoomOutgoingTextMsgBubbleCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomBubbleList/MXKRoomOutgoingTextMsgWithoutSenderInfoBubbleCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarView.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithHPGrowingText.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithSimpleTextView.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomList/MXKInterleavedRecentTableViewCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomList/MXKPublicRoomTableViewCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomList/MXKRecentTableViewCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomMemberList/MXKRoomMemberTableViewCell.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomTitle/MXKRoomTitleView.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/RoomTitle/MXKRoomTitleViewWithTopic.xib", - "${PODS_ROOT}/../../matrix-ios-kit/MatrixKit/Views/Search/MXKSearchTableViewCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKAccountDetailsViewController.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKAttachmentsViewController.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKAuthenticationViewController.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKCallViewController.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKContactDetailsViewController.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKContactListViewController.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKCountryPickerViewController.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKLanguagePickerViewController.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKRecentListViewController.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKRoomMemberDetailsViewController.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKRoomMemberListViewController.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKRoomSettingsViewController.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKRoomViewController.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKSearchViewController.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/Account/MXKAccountTableViewCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/Authentication/MXKAuthInputsEmailCodeBasedView.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/Authentication/MXKAuthInputsPasswordBasedView.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/Contact/MXKContactTableCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/DeviceView/MXKDeviceView.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/EncryptionInfoView/MXKEncryptionInfoView.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKCollectionViewCell/MXKMediaCollectionViewCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKEventDetailsView.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKPieChartHUD.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKRoomCreationView.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithButton.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndButton.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndImageView.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndMXKImageView.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndSlider.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndSubLabel.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndSwitch.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndTextField.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelTextFieldAndButton.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithPicker.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithSearchBar.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithTextFieldAndButton.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithTextView.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/PushRule/MXKPushRuleCreationTableViewCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/PushRule/MXKPushRuleTableViewCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/ReadReceipts/MXKReadReceiptTableViewCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomBubbleList/MXKRoomEmptyBubbleTableViewCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomBubbleList/MXKRoomIncomingAttachmentBubbleCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomBubbleList/MXKRoomIncomingAttachmentWithoutSenderInfoBubbleCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomBubbleList/MXKRoomIncomingTextMsgBubbleCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomBubbleList/MXKRoomIncomingTextMsgWithoutSenderInfoBubbleCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomBubbleList/MXKRoomIOSOutgoingBubbleTableViewCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomBubbleList/MXKRoomOutgoingAttachmentBubbleCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomBubbleList/MXKRoomOutgoingAttachmentWithoutSenderInfoBubbleCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomBubbleList/MXKRoomOutgoingTextMsgBubbleCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomBubbleList/MXKRoomOutgoingTextMsgWithoutSenderInfoBubbleCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarView.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithHPGrowingText.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithSimpleTextView.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomList/MXKInterleavedRecentTableViewCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomList/MXKPublicRoomTableViewCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomList/MXKRecentTableViewCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomMemberList/MXKRoomMemberTableViewCell.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomTitle/MXKRoomTitleView.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/RoomTitle/MXKRoomTitleViewWithTopic.xib", + "${PODS_ROOT}/MatrixKit/MatrixKit/Views/Search/MXKSearchTableViewCell.xib", "$PODS_CONFIGURATION_BUILD_DIR/MatrixKit/MatrixKit.bundle", - "${PODS_ROOT}/../../matrix-ios-sdk/MatrixSDK/Data/Store/MXCoreDataStore/MXCoreDataStore.xcdatamodeld", + "${PODS_ROOT}/MatrixSDK/MatrixSDK/Data/Store/MXCoreDataStore/MXCoreDataStore.xcdatamodeld", ); name = "[CP] Copy Pods Resources"; outputPaths = ( @@ -2963,7 +2963,7 @@ ); inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-RiotShareExtension/Pods-RiotShareExtension-resources.sh", - "${PODS_ROOT}/../../matrix-ios-sdk/MatrixSDK/Data/Store/MXCoreDataStore/MXCoreDataStore.xcdatamodeld", + "${PODS_ROOT}/MatrixSDK/MatrixSDK/Data/Store/MXCoreDataStore/MXCoreDataStore.xcdatamodeld", ); name = "[CP] Copy Pods Resources"; outputPaths = ( @@ -3315,7 +3315,7 @@ INFOPLIST_FILE = RiotShareExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = im.vector.app.share.extension; + PRODUCT_BUNDLE_IDENTIFIER = im.vector.app.shareExtension; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; @@ -3338,7 +3338,7 @@ INFOPLIST_FILE = RiotShareExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = im.vector.app.share.extension; + PRODUCT_BUNDLE_IDENTIFIER = im.vector.app.shareExtension; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; diff --git a/Riot/AppDelegate.h b/Riot/AppDelegate.h index 863f96b08..dd33b3579 100644 --- a/Riot/AppDelegate.h +++ b/Riot/AppDelegate.h @@ -116,6 +116,13 @@ extern NSString *const kAppDelegateNetworkStatusDidChangeNotification; - (void)registerUserNotificationSettings; +/** + Perform registration for remote notifications. + + @param completion the block to be executed when registration finished. + */ +- (void)registerForRemoteNotificationsWithCompletion:(void (^)(NSError *))completion; + #pragma mark - Matrix Room handling - (void)showRoom:(NSString*)roomId andEventId:(NSString*)eventId withMatrixSession:(MXSession*)mxSession; diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 10a5f7802..c5b99a49c 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -167,6 +167,8 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN @property (strong, nonatomic) UIAlertController *mxInAppNotification; +@property (nonatomic, nullable, copy) void (^registrationForRemoteNotificationsCompletion)(NSError *); + @end @implementation AppDelegate @@ -890,12 +892,24 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } } +- (void)registerForRemoteNotificationsWithCompletion:(nullable void (^)(NSError *))completion +{ + self.registrationForRemoteNotificationsCompletion = completion; + [[UIApplication sharedApplication] registerForRemoteNotifications]; +} + - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings { // Register for remote notifications only if user provide access to notification feature if (notificationSettings.types != UIUserNotificationTypeNone) { - [application registerForRemoteNotifications]; + [self registerForRemoteNotificationsWithCompletion:nil]; + } + else + { + // Clear existing token + MXKAccountManager* accountManager = [MXKAccountManager sharedManager]; + [accountManager setApnsDeviceToken:nil]; } } @@ -908,11 +922,23 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN [accountManager setApnsDeviceToken:deviceToken]; isAPNSRegistered = YES; + + if (self.registrationForRemoteNotificationsCompletion) + { + self.registrationForRemoteNotificationsCompletion(nil); + self.registrationForRemoteNotificationsCompletion = nil; + } } - (void)application:(UIApplication*)app didFailToRegisterForRemoteNotificationsWithError:(NSError*)error { NSLog(@"[AppDelegate] Failed to register for APNS: %@", error); + + if (self.registrationForRemoteNotificationsCompletion) + { + self.registrationForRemoteNotificationsCompletion(error); + self.registrationForRemoteNotificationsCompletion = nil; + } } - (void)cancelBackgroundSync @@ -1439,6 +1465,9 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN MXSDKOptions *sdkOptions = [MXSDKOptions sharedInstance]; + // Set the App Group identifier. + sdkOptions.applicationGroupIdentifier = @"group.im.vector"; + // Define the media cache version sdkOptions.mediaCacheAppVersion = 0; @@ -1453,6 +1482,9 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // Use UIKit BackgroundTask for handling background tasks in the SDK sdkOptions.backgroundModeHandler = [[MXUIKitBackgroundModeHandler alloc] init]; + + // Get modular widget events in rooms histories + [[MXKAppSettings standardAppSettings] addSupportedEventTypes:@[kWidgetEventTypeString]]; // Disable long press on event in bubble cells [MXKRoomBubbleTableViewCell disableLongPressGestureOnEvent:YES]; @@ -1501,6 +1533,11 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // Each room member will be considered as a potential contact. [MXKContactManager sharedManager].contactManagerMXRoomSource = MXKContactManagerMXRoomSourceAll; + + // Send read receipts for modular widgets events too + NSMutableArray *acknowledgableEventTypes = [NSMutableArray arrayWithArray:mxSession.acknowledgableEventTypes]; + [acknowledgableEventTypes addObject:kWidgetEventTypeString]; + mxSession.acknowledgableEventTypes = acknowledgableEventTypes; } else if (mxSession.state == MXSessionStateStoreDataReady) { @@ -1614,8 +1651,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN }]; - // Apply the application group name, and add observer on settings changes. - [MXKAppSettings standardAppSettings].applicationGroup = @"group.im.vector"; + // Add observer on settings changes. [[MXKAppSettings standardAppSettings] addObserver:self forKeyPath:@"showAllEventsInRoomHistory" options:0 context:nil]; // Prepare account manager @@ -2352,7 +2388,23 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN { if (currentCallViewController && callViewController == currentCallViewController) { - if (callViewController.isBeingPresented) + if (_incomingCallNotification) + { + // The user was prompted for an incoming call which ended + // The call view controller was not presented yet. + [_incomingCallNotification dismissViewControllerAnimated:NO completion:nil]; + _incomingCallNotification = nil; + + // Release properly + [currentCallViewController destroy]; + currentCallViewController = nil; + + if (completion) + { + completion(); + } + } + else if (callViewController.isBeingPresented) { // Here the presentation of the call view controller is in progress // Postpone the dismiss diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index c246df64d..3d513af8d 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -453,6 +453,8 @@ // Events formatter "event_formatter_member_updates" = "%tu membership changes"; +"event_formatter_jitsi_widget_added" = "VoIP conference added by %@"; +"event_formatter_jitsi_widget_removed" = "VoIP conference removed by %@"; // Others "or" = "or"; diff --git a/Riot/Categories/UIViewController+RiotSearch.m b/Riot/Categories/UIViewController+RiotSearch.m index 7f53a9556..9db702f76 100644 --- a/Riot/Categories/UIViewController+RiotSearch.m +++ b/Riot/Categories/UIViewController+RiotSearch.m @@ -19,6 +19,8 @@ #import +#import "RiotDesignValues.h" + /** `UIViewControllerRiotSearchInternals` is the internal single point storage for the search feature. @@ -91,6 +93,10 @@ // Reset searches self.searchBar.text = @""; + // Customize search bar + self.searchBar.barStyle = kRiotDesignSearchBarStyle; + self.searchBar.tintColor = kRiotDesignSearchBarTintColor; + // Remove navigation buttons self.navigationItem.hidesBackButton = YES; self.navigationItem.rightBarButtonItem = nil; diff --git a/Riot/Info.plist b/Riot/Info.plist index 67e088a49..ad1ee7d7b 100644 --- a/Riot/Info.plist +++ b/Riot/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.5.2 + 0.5.3 CFBundleSignature ???? CFBundleVersion - 0.5.2 + 0.5.3 ITSAppUsesNonExemptEncryption ITSEncryptionExportComplianceCode diff --git a/Riot/Utils/EventFormatter.m b/Riot/Utils/EventFormatter.m index 91370a3be..6fb500e2d 100644 --- a/Riot/Utils/EventFormatter.m +++ b/Riot/Utils/EventFormatter.m @@ -19,6 +19,8 @@ #import "RiotDesignValues.h" +#import "WidgetManager.h" + @interface EventFormatter () { /** @@ -35,6 +37,53 @@ @implementation EventFormatter +- (NSAttributedString *)attributedStringFromEvent:(MXEvent *)event withRoomState:(MXRoomState *)roomState error:(MXKEventFormatterError *)error +{ + // Build strings for modular widget events + // TODO: At the moment, we support only jitsi widgets + if (event.eventType == MXEventTypeCustom + && [event.type isEqualToString:kWidgetEventTypeString]) + { + NSString *displayText; + + // Prepare the display name of the sender + NSString *senderDisplayName = roomState ? [self senderDisplayNameForEvent:event withRoomState:roomState] : event.sender; + + if ([event.content[@"type"] isEqualToString:kWidgetTypeJitsi]) + { + // This is an alive jitsi widget + displayText = [NSString stringWithFormat:NSLocalizedStringFromTable(@"event_formatter_jitsi_widget_added", @"Vector", nil), senderDisplayName]; + } + else if (event.content.count == 0) + { + // This is a closed widget + // Check if it corresponds to a jitsi widget by looking at other state events for + // this jitsi widget (widget id = event.stateKey). + for (MXEvent *widgetStateEvent in [roomState stateEventsWithType:kWidgetEventTypeString]) + { + if ([widgetStateEvent.stateKey isEqualToString:event.stateKey] && [widgetStateEvent.content[@"type"] isEqualToString:kWidgetTypeJitsi]) + { + displayText = [NSString stringWithFormat:NSLocalizedStringFromTable(@"event_formatter_jitsi_widget_removed", @"Vector", nil), senderDisplayName]; + break; + } + } + } + + if (displayText) + { + if (error) + { + *error = MXKEventFormatterErrorNone; + } + + // Build the attributed string with the right font and color for the events + return [self renderString:displayText forEvent:event]; + } + } + + return [super attributedStringFromEvent:event withRoomState:roomState error:error]; +} + - (NSAttributedString*)attributedStringFromEvents:(NSArray*)events withRoomState:(MXRoomState*)roomState error:(MXKEventFormatterError*)error { NSString *displayText; @@ -79,7 +128,7 @@ white-space: pre; \ -coretext-fontname: Menlo-Regular; \ font-size: small; \ - }", bgColor]; + }", (unsigned long)bgColor]; self.defaultTextColor = kRiotPrimaryTextColor; self.subTitleTextColor = kRiotSecondaryTextColor; diff --git a/Riot/Utils/Widgets/Widget.h b/Riot/Utils/Widgets/Widget.h index c645e7e7a..9cc1e89ec 100644 --- a/Riot/Utils/Widgets/Widget.h +++ b/Riot/Utils/Widgets/Widget.h @@ -19,7 +19,7 @@ #import /** - The `Widget` class represents scalar widget information. + The `Widget` class represents modular widget information. */ @interface Widget : NSObject diff --git a/Riot/Utils/Widgets/Widget.m b/Riot/Utils/Widgets/Widget.m index 8bfc1574a..381e23c48 100644 --- a/Riot/Utils/Widgets/Widget.m +++ b/Riot/Utils/Widgets/Widget.m @@ -24,7 +24,7 @@ { if (![widgetEvent.type isEqualToString:kWidgetEventTypeString]) { - // The Widget class works only with scalar, aka "im.vector.modular.widgets", widgets + // The Widget class works only with modular, aka "im.vector.modular.widgets", widgets return nil; } diff --git a/Riot/Utils/Widgets/WidgetManager.h b/Riot/Utils/Widgets/WidgetManager.h index 3e20e5a32..4a0833e02 100644 --- a/Riot/Utils/Widgets/WidgetManager.h +++ b/Riot/Utils/Widgets/WidgetManager.h @@ -21,7 +21,7 @@ #import "Widget.h" /** - The type of matrix event used for scalar widgets. + The type of matrix event used for modular widgets. */ FOUNDATION_EXPORT NSString *const kWidgetEventTypeString; @@ -50,7 +50,7 @@ WidgetManagerErrorCode; /** - The `WidgetManager` helps to handle scalar widgets. + The `WidgetManager` helps to handle modular widgets. */ @interface WidgetManager : NSObject @@ -80,7 +80,7 @@ WidgetManagerErrorCode; /** - Add a scalar widget to a room. + Add a modular widget to a room. @param widgetId the id of the widget. @param widgetContent the widget content. diff --git a/Riot/Utils/Widgets/WidgetManager.m b/Riot/Utils/Widgets/WidgetManager.m index 19cdf3df1..ce390a05c 100644 --- a/Riot/Utils/Widgets/WidgetManager.m +++ b/Riot/Utils/Widgets/WidgetManager.m @@ -158,7 +158,7 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain"; } // Send a state event with the widget data - // TODO: This API will be shortly replaced by a pure scalar API + // TODO: This API will be shortly replaced by a pure modular API return [room sendStateEventOfType:kWidgetEventTypeString content:widgetContent stateKey:widgetId @@ -181,7 +181,7 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain"; NSString *confId = [room.roomId substringWithRange:NSMakeRange(1, [room.roomId rangeOfString:@":"].location - 1)]; confId = [confId stringByAppendingString:widgetSessionId]; - // TODO: This url may come from scalar API + // TODO: This url may come from modular API // Note: this url can be used as is inside a web container (like iframe for Riot-web) // Riot-iOS does not directly use it but extracts params from it (see `[JitsiViewController openWidget:withVideo:]`) NSString *url = [NSString stringWithFormat:@"https://scalar-staging.riot.im/scalar/api/widgets/jitsi.html?confId=%@&isAudioConf=%@&displayName=$matrix_display_name&avatarUrl=$matrix_avatar_url&email=$matrix_user_id@", confId, video ? @"false" : @"true"]; @@ -216,7 +216,7 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain"; } // Send a state event with an empty content to disable the widget - // TODO: This API will be shortly replaced by a pure scalar API + // TODO: This API will be shortly replaced by a pure modular API return [room sendStateEventOfType:kWidgetEventTypeString content:@{} stateKey:widgetId diff --git a/Riot/ViewController/SettingsViewController.m b/Riot/ViewController/SettingsViewController.m index dfc8ad67d..b37d1e6e0 100644 --- a/Riot/ViewController/SettingsViewController.m +++ b/Riot/ViewController/SettingsViewController.m @@ -2562,7 +2562,8 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(); - (void)togglePushNotifications:(id)sender { // Check first whether the user allow notification from device settings - if ([[MXKAccountManager sharedManager] isAPNSAvailable] == NO) + UIUserNotificationType currentUserNotificationTypes = UIApplication.sharedApplication.currentUserNotificationSettings.types; + if (currentUserNotificationTypes == UIUserNotificationTypeNone) { [currentAlert dismissViewControllerAnimated:NO completion:nil]; @@ -2594,10 +2595,28 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(); { [self startActivityIndicator]; - MXKAccount* account = [MXKAccountManager sharedManager].activeAccounts.firstObject; + MXKAccountManager *accountManager = [MXKAccountManager sharedManager]; + MXKAccount* account = accountManager.activeAccounts.firstObject; - // toggle the pushes - [account setEnablePushNotifications:!account.pushNotificationServiceIsActive]; + if (accountManager.apnsDeviceToken) + { + [account setEnablePushNotifications:!account.pushNotificationServiceIsActive]; + } + else + { + // Obtain device token when user has just enabled access to notifications from system settings + [[AppDelegate theDelegate] registerForRemoteNotificationsWithCompletion:^(NSError * error) { + if (error) + { + [(UISwitch *)sender setOn:NO animated:YES]; + [self stopActivityIndicator]; + } + else + { + [account setEnablePushNotifications:YES]; + } + }]; + } } } diff --git a/Riot/ViewController/Widgets/JitsiViewController.h b/Riot/ViewController/Widgets/JitsiViewController.h index f6368bc18..0d175de00 100644 --- a/Riot/ViewController/Widgets/JitsiViewController.h +++ b/Riot/ViewController/Widgets/JitsiViewController.h @@ -24,7 +24,7 @@ /** The `JitsiViewController` is a VC for specifically handling a jitsi widget using the - jitsi-meet iOS SDK instead of displaying it in a webview like other scalar widgets. + jitsi-meet iOS SDK instead of displaying it in a webview like other modular widgets. https://github.com/jitsi/jitsi-meet/tree/master/ios */ diff --git a/RiotShareExtension/Info.plist b/RiotShareExtension/Info.plist index 251562e64..0889a1471 100644 --- a/RiotShareExtension/Info.plist +++ b/RiotShareExtension/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.0 + 0.5.3 CFBundleVersion 1 NSExtension @@ -29,13 +29,13 @@ NSExtensionActivationRule NSExtensionActivationSupportsMovieWithMaxCount - 1 + 0 NSExtensionActivationSupportsImageWithMaxCount - 1 + 0 NSExtensionActivationSupportsWebURLWithMaxCount - 1 + 0 NSExtensionActivationSupportsText - + NSExtensionPointIdentifier diff --git a/RiotShareExtension/Model/ShareExtensionManager.h b/RiotShareExtension/Model/ShareExtensionManager.h index 1c54e4bd7..065b59b2e 100644 --- a/RiotShareExtension/Model/ShareExtensionManager.h +++ b/RiotShareExtension/Model/ShareExtensionManager.h @@ -18,6 +18,7 @@ #import @class ShareExtensionManager; +@class SharePresentingViewController; /** Posted when the matrix session has been changed. @@ -64,6 +65,11 @@ extern NSString *const kShareExtensionManagerDidChangeMXSessionNotification; */ @property (nonatomic) NSExtensionContext *shareExtensionContext; +/** + The share app extension’s primary view controller. + */ +@property (nonatomic) SharePresentingViewController *primaryViewController; + /** The associated matrix session (nil by default). */ diff --git a/RiotShareExtension/Model/ShareExtensionManager.m b/RiotShareExtension/Model/ShareExtensionManager.m index 421fbfbf2..47a679a0b 100644 --- a/RiotShareExtension/Model/ShareExtensionManager.m +++ b/RiotShareExtension/Model/ShareExtensionManager.m @@ -15,6 +15,7 @@ */ #import "ShareExtensionManager.h" +#import "SharePresentingViewController.h" #import "MXKPieChartHUD.h" @import MobileCoreServices; @@ -60,8 +61,12 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode) [[NSNotificationCenter defaultCenter] addObserver:sharedInstance selector:@selector(checkUserAccount) name:NSExtensionHostWillEnterForegroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:sharedInstance selector:@selector(suspendSession) name:NSExtensionHostDidEnterBackgroundNotification object:nil]; + MXSDKOptions *sdkOptions = [MXSDKOptions sharedInstance]; + // Apply the application group - [MXKAppSettings standardAppSettings].applicationGroup = @"group.im.vector"; + sdkOptions.applicationGroupIdentifier = @"group.im.vector"; + // Disable identicon use + sdkOptions.disableIdenticonUseForUserAvatar = YES; }); return sharedInstance; } @@ -293,10 +298,23 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode) { [self.shareExtensionContext cancelRequestWithError:[NSError errorWithDomain:@"MXFailureErrorDomain" code:500 userInfo:nil]]; } + + [self.primaryViewController destroy]; + self.primaryViewController = nil; } #pragma mark - Private +- (void)completeRequestReturningItems:(nullable NSArray *)items completionHandler:(void(^ __nullable)(BOOL expired))completionHandler; +{ + [self suspendSession]; + + [self.shareExtensionContext completeRequestReturningItems:items completionHandler:completionHandler]; + + [self.primaryViewController destroy]; + self.primaryViewController = nil; +} + - (UIAlertController *)compressionPromptForImage:(UIImage *)image shareBlock:(void(^)())shareBlock { UIAlertController *compressionPrompt; @@ -484,8 +502,7 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode) if (weakSelf) { typeof(self) self = weakSelf; - [self suspendSession]; - [self.shareExtensionContext completeRequestReturningItems:@[extensionItem] completionHandler:nil]; + [self completeRequestReturningItems:@[extensionItem] completionHandler:nil]; } } failure:^(NSError *error) { NSLog(@"[ShareExtensionManager] sendTextMessage failed."); @@ -520,8 +537,7 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode) if (weakSelf) { typeof(self) self = weakSelf; - [self suspendSession]; - [self.shareExtensionContext completeRequestReturningItems:@[extensionItem] completionHandler:nil]; + [self completeRequestReturningItems:@[extensionItem] completionHandler:nil]; } } failure:^(NSError *error) { NSLog(@"[ShareExtensionManager] sendFile failed."); @@ -594,8 +610,7 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode) if (weakSelf) { typeof(self) self = weakSelf; - [self suspendSession]; - [self.shareExtensionContext completeRequestReturningItems:@[extensionItem] completionHandler:nil]; + [self completeRequestReturningItems:@[extensionItem] completionHandler:nil]; } } failure:^(NSError *error) { NSLog(@"[ShareExtensionManager] sendImage failed."); @@ -635,8 +650,7 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode) if (weakSelf) { typeof(self) self = weakSelf; - [self suspendSession]; - [self.shareExtensionContext completeRequestReturningItems:@[extensionItem] completionHandler:nil]; + [self completeRequestReturningItems:@[extensionItem] completionHandler:nil]; } } failure:^(NSError *error) { NSLog(@"[ShareExtensionManager] sendVideo failed."); diff --git a/RiotShareExtension/ViewController/SharePresentingViewController.h b/RiotShareExtension/ViewController/SharePresentingViewController.h index 430f568ba..c9eff12d0 100644 --- a/RiotShareExtension/ViewController/SharePresentingViewController.h +++ b/RiotShareExtension/ViewController/SharePresentingViewController.h @@ -18,4 +18,6 @@ @interface SharePresentingViewController : UIViewController +- (void)destroy; + @end diff --git a/RiotShareExtension/ViewController/SharePresentingViewController.m b/RiotShareExtension/ViewController/SharePresentingViewController.m index 081c328b7..13c7390e8 100644 --- a/RiotShareExtension/ViewController/SharePresentingViewController.m +++ b/RiotShareExtension/ViewController/SharePresentingViewController.m @@ -20,6 +20,8 @@ @interface SharePresentingViewController () +@property (nonatomic) ShareViewController *shareViewController; + @end @implementation SharePresentingViewController @@ -28,21 +30,33 @@ { [super viewDidLoad]; - [ShareExtensionManager sharedManager].shareExtensionContext = self.extensionContext; + ShareExtensionManager *sharedManager = [ShareExtensionManager sharedManager]; + + sharedManager.primaryViewController = self; + sharedManager.shareExtensionContext = self.extensionContext; [self presentShareViewController]; } +- (void)destroy +{ + if (self.shareViewController) + { + [self.shareViewController destroy]; + self.shareViewController = nil; + } +} + - (void)presentShareViewController { - ShareViewController *shareViewController = [[ShareViewController alloc] init]; + self.shareViewController = [[ShareViewController alloc] init]; - shareViewController.providesPresentationContextTransitionStyle = YES; - shareViewController.definesPresentationContext = YES; - shareViewController.modalPresentationStyle = UIModalPresentationOverFullScreen; - shareViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; + self.shareViewController.providesPresentationContextTransitionStyle = YES; + self.shareViewController.definesPresentationContext = YES; + self.shareViewController.modalPresentationStyle = UIModalPresentationOverFullScreen; + self.shareViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; - [self presentViewController:shareViewController animated:YES completion:nil]; + [self presentViewController:self.shareViewController animated:YES completion:nil]; } - (void)didReceiveMemoryWarning diff --git a/RiotShareExtension/ViewController/ShareViewController.h b/RiotShareExtension/ViewController/ShareViewController.h index a7ce75c4d..74e7af78a 100644 --- a/RiotShareExtension/ViewController/ShareViewController.h +++ b/RiotShareExtension/ViewController/ShareViewController.h @@ -14,7 +14,6 @@ limitations under the License. */ -#import #import #import diff --git a/RiotShareExtension/ViewController/ShareViewController.m b/RiotShareExtension/ViewController/ShareViewController.m index 781a51525..e02961a28 100644 --- a/RiotShareExtension/ViewController/ShareViewController.m +++ b/RiotShareExtension/ViewController/ShareViewController.m @@ -30,6 +30,8 @@ @property (nonatomic) SegmentedViewController *segmentedViewController; +@property (nonatomic) id shareExtensionManagerDidChangeMXSessionObserver; + @end @@ -42,7 +44,7 @@ { [super viewDidLoad]; - [[NSNotificationCenter defaultCenter] addObserverForName:kShareExtensionManagerDidChangeMXSessionNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { + self.shareExtensionManagerDidChangeMXSessionObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kShareExtensionManagerDidChangeMXSessionNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { [self configureViews]; @@ -51,12 +53,21 @@ [self configureViews]; } -#pragma mark - Private - -- (void)configureViews +- (void)destroy { - self.masterContainerView.layer.cornerRadius = 7; + [super destroy]; + if (self.shareExtensionManagerDidChangeMXSessionObserver) + { + [[NSNotificationCenter defaultCenter] removeObserver:self.shareExtensionManagerDidChangeMXSessionObserver]; + self.shareExtensionManagerDidChangeMXSessionObserver = nil; + } + + [self resetContentView]; +} + +- (void)resetContentView +{ // Empty the content view NSArray *subviews = self.contentView.subviews; for (UIView *subview in subviews) @@ -67,10 +78,21 @@ // Release the current segmented view controller if any if (self.segmentedViewController) { + [self.segmentedViewController removeFromParentViewController]; + // Release correctly all the existing data source and view controllers. [self.segmentedViewController destroy]; self.segmentedViewController = nil; } +} + +#pragma mark - Private + +- (void)configureViews +{ + self.masterContainerView.layer.cornerRadius = 7; + + [self resetContentView]; if ([ShareExtensionManager sharedManager].mxSession) {