Register for Local Notification

后端 未结 1 827
执念已碎
执念已碎 2021-01-23 04:40

I am developing an IOS application with phonegap and need to set local notification for it which will repeat on every friday and specified time

Also there is requirement

相关标签:
1条回答
  • 2021-01-23 04:45

    I recommend you read the following article on the topic which i found very helpful

    http://useyourloaf.com/blog/2010/7/31/adding-local-notifications-with-ios-4.html

    - (void)scheduleNotification {
    
        [[UIApplication sharedApplication] cancelAllLocalNotifications];
    
            UILocalNotification *notif = [[UILocalNotification alloc] init];
            notif.fireDate = [datePicker date];
            notif.timeZone = [NSTimeZone defaultTimeZone];
    
            notif.alertBody = @"Body";
            notif.alertAction = @"AlertButtonCaption";
            notif.soundName = UILocalNotificationDefaultSoundName;
            notif.applicationIconBadgeNumber = 1;
    
           [[UIApplication sharedApplication] scheduleLocalNotification:notif];
            [notif release];
        }
    }
    

    This is just a basic outline of how it works but starting from this you should be able to schedule a notification.

    0 讨论(0)
提交回复
热议问题