0
示例: - 我已生成4個本地通知,其中4個類型處於最小化狀態。當應用程序最小化時獲取本地通知文本ios
下面的通知類型。
消息
朋友請求
視頻通話
音頻呼叫
通知在通知中心中。
Noow..I點擊了第二個通知,
我怎樣才能得到它的通知點擊數?
我如何獲得第二次通知正文提醒文本(內容)?
this mehod is not working for minimize state
例如WhatsApp。我需要根據通知類型去特定的屏幕上。
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type {
NSString *[email protected]"";
if ([[payload.dictionaryPayload valueForKey:@"type"]isEqualToString:@"video"]) {
[email protected]"video";
}
else if ([[payload.dictionaryPayload valueForKey:@"type"]isEqualToString:@"friendRequest"]) {
[email protected]"friend Request";
}
else if([[payload.dictionaryPayload valueForKey:@"type"] isEqualToString:@"message"])
{
[email protected]"message";
}
else{
[email protected]"audio";
}
我創建UILocalNotification
這樣的:
UILocalNotification *notification = [[UILocalNotification alloc]init];
notification.repeatInterval = NSDayCalendarUnit;
[notification setAlertBody:Notitype];
[notification setFireDate:[NSDate dateWithTimeIntervalSinceNow:1]];
[notification setTimeZone:[NSTimeZone defaultTimeZone]];
[[UIApplication sharedApplication] setScheduledLocalNotifications:[NSArray arrayWithObject:notification]];
處理您可以請顯示您的代碼,您如何設置您的本地通知 –
我已更新的代碼。 @NhhleshBagdiya請檢查 –