2014-04-08 3 views
0

내가 개발 한 응용 프로그램에서 iOS Reminder 응용 프로그램을 사용할 수 있습니까? 개방형 알림 응용 프로그램을 내 응용 프로그램에서 종료하므로 OPEN URL 개념을 사용하지 않겠습니까? iOS SDk에서 작성한 맞춤 알림 프로그램을 사용해주세요. iOS의 알림 응용 프로그램에 알림 가 생성됩니다.iOS 응용 프로그램 내에서 미리 알림 응용 프로그램을 여는 중입니까?

+0

당신은 알림을 설정하는 UILocalNotification을 사용할 수 있습니다. –

답변

1

미리 알림을 만들고 검색 할 수있는 미리 알림 API가 있습니다.

먼저 그렇게 할 사용자 권한을 요청해야합니다 :

EKEventStore *store = [[EKEventStore alloc] initWithAccessToEntityTypes:EKEntityMaskReminder]; 
[store requestAccessToEntityType:EKEntityTypeReminder completion:^(BOOL granted, NSError *error) { 
    if (granted) { 
     [self createReminder:store]; 
    } 
    else { 
     // :(
    } 
}]; 

당신이 할 수있는 알림을 만들려면 :

- (void)createReminder:(EKEventStore *)store { 
    //Create a reminder instance 
    EKReminder *aReminder = [EKReminder reminderWithEventStore:store]; 

    // Set the properties 
    aReminder.title = @"Remember to do X"; 
    ... 

    // Then save the reminder to the store 
    NSError *error = nil; 
    [store saveReminder:aReminder commit:YES error:&error]; 

    // Be responsible 
    if (error) { 
     [self rememberToHandleYourErrors:error]; 
    } 
} 
관련 문제