你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> IOS成長之路-推送(本地推送)

IOS成長之路-推送(本地推送)

編輯:IOS開發綜合
1、打開本地推送並設置屬性     [cpp]  NSString *str = @"本地推送的信息";       UIApplication *app = [UIApplication sharedApplication];       UILocalNotification *notification = [[UILocalNotification alloc]init];//初始化本地推送        notification.soundName = UILocalNotificationDefaultSoundName;//設置聲音        notification.alertBody = str;//設置推送的消息        [app scheduleLocalNotification:notification];//實現本地推送的關鍵步驟,        [notification release];       [str release];     NSString *str = @"本地推送的信息";     UIApplication *app = [UIApplication sharedApplication];     UILocalNotification *notification = [[UILocalNotification alloc]init];//初始化本地推送     notification.soundName = UILocalNotificationDefaultSoundName;//設置聲音     notification.alertBody = str;//設置推送的消息     [app scheduleLocalNotification:notification];//實現本地推送的關鍵步驟,     [notification release];     [str release];通過上面的方法可以實現推送的效果     2、本地推送的接受方法      [cpp] - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification     - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification  
  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved