Remove all TODOs

This commit is contained in:
Paul Cartier 2020-03-23 14:24:40 +01:00
parent 6921587447
commit 10390bd67a
4 changed files with 16 additions and 12 deletions

View file

@ -570,7 +570,9 @@
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
LOGI(@"[APNs] %@ : %@", NSStringFromSelector(_cmd), deviceToken);
[LinphoneManager.instance setRemoteNotificationToken:deviceToken];
dispatch_async(dispatch_get_main_queue(), ^{
[LinphoneManager.instance setRemoteNotificationToken:deviceToken];
});
}
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
@ -582,7 +584,7 @@
- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(PKPushType)type {
LOGI(@"[PushKit] credentials updated with voip token: %@", credentials.token);
dispatch_async(dispatch_get_main_queue(), ^{ // TODO PAUL : why?
dispatch_async(dispatch_get_main_queue(), ^{
[LinphoneManager.instance setPushKitToken:credentials.token];
});
}
@ -595,8 +597,9 @@
- (void)processPush:(NSDictionary *)userInfo {
LOGI(@"[PushKit] Notification [%p] received with payload : %@", userInfo, userInfo.description);
// prevent app to crash if pushKit received for msg
if ([userInfo[@"aps"][@"loc-key"] isEqualToString:@"IM_MSG"]) { // TODO PAUL: a supprimer, fix temporaire: le serveur n'enverra plus de pushkit pr les msg
// prevent app to crash if PushKit received for msg
if ([userInfo[@"aps"][@"loc-key"] isEqualToString:@"IM_MSG"]) {
LOGE(@"Received a legacy PushKit notification for a chat message");
return;
}
[LinphoneManager.instance startLinphoneCore];

View file

@ -2094,11 +2094,14 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
timeout = @"";
}
// dummy value, for later use
NSString *teamId = @"ABCD1234";
NSString *params = [NSString
stringWithFormat:@"pn-provider=apns%@;pn-prid=%@;pn-param=ABCD1234.%@.%@;pn-msg-str=IM_MSG;pn-call-str=IC_MSG;pn-"
stringWithFormat:@"pn-provider=apns%@;pn-prid=%@;pn-param=%@.%@.%@;pn-msg-str=IM_MSG;pn-call-str=IC_MSG;pn-"
@"call-snd=%@;pn-msg-snd=msg.caf%@;pn-silent=1",
APPMODE_SUFFIX, token, [[NSBundle mainBundle] bundleIdentifier], services, ring, timeout];
// TODO PAUL : do we need the team id?
APPMODE_SUFFIX, token, teamId, [[NSBundle mainBundle] bundleIdentifier], services, ring, timeout];
LOGI(@"Proxy config %s configured for push notifications with contact: %@",
linphone_proxy_config_get_identity(proxyCfg), params);
linphone_proxy_config_set_contact_uri_parameters(proxyCfg, [params UTF8String]);

View file

@ -57,9 +57,7 @@ class NotificationViewController: UIViewController, UNNotificationContentExtensi
coreStopped = false
}
func didReceive(_ notification: UNNotification) {
self.title = "test test test" // TODO PAUL : a enlever
}
func didReceive(_ notification: UNNotification) {}
func didReceive(_ response: UNNotificationResponse,
completionHandler completion: @escaping (UNNotificationContentExtensionResponseOption) -> Void) {

View file

@ -110,8 +110,8 @@ class NotificationService: UNNotificationServiceExtension {
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
NSLog("[msgNotificationService] serviceExtensionTimeWillExpire")
bestAttemptContent.categoryIdentifier = "app_active"
bestAttemptContent.title = NSLocalizedString("Message received", comment: "") + " [time out]" // TODO PAUL : a enlever
bestAttemptContent.body = NSLocalizedString("You have received a message.", comment: "")
bestAttemptContent.title = NSLocalizedString("Message received", comment: "")
bestAttemptContent.body = NSLocalizedString("You have received a message.", comment: "")
contentHandler(bestAttemptContent)
}
}