在我的應用程序中,我使用了報警功能。它的工作正常,但當我在模擬器測試通過彈出框通知警報。在真實設備它只是作爲通知在狀態欄而不是彈出框。彈出警報框不顯示?
我正在尋找實際設備中的彈出框。我不確定我在這裏做錯了什麼?
我使用此代碼爲我的報警
[[UIApplication sharedApplication] cancelAllLocalNotifications];
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = date;
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.alertBody = alarmMessage;
localNotification.alertAction = NSLocalizedString(@"View", nil);
localNotification.repeatInterval = NSDayCalendarUnit;
/* Here we set notification sound and badge on the app's icon "-1"
means that number indicator on the badge will be decreased by one
- so there will be no badge on the icon */
NSString *ringtonename = [lblRingToneName text];
NSString *extension = @".caf";
NSString *ringtone = [[NSString alloc]initWithFormat:@"%@%@", ringtonename, extension];
localNotification.soundName = ringtone;
localNotification.applicationIconBadgeNumber = -1;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
感謝您的幫助球員
hi是你的代碼localNotification.repeatInterval = NSDayCalendarUnit;工作正常....? – Rajneesh071
是的,這是工作罰款Rajneesh – GoCrazy
我也在工作這樣的類型的應用程序....但是,當我登錄火災日期其顯示不同的日期,但本地noti來完美的時間...爲什麼這個表演差異日期日誌? – Rajneesh071