'UIRemoteNotificationTypeBadge'에 해당되는 글 1건

  1. 2012.06.20 APSN 설정 처리
iOS2012. 6. 20. 20:22


APNS 프로세스 정리 URL : 

http://www.imaso.co.kr/?doc=bbs/gnuboard.php&bo_table=article&wr_id=38399




APNS 설정 처리 관련 : 

설정>알림 > 해당 App 알림 설정에 가면


알림센터

보기

알림스타일

아이콘에 알림표시

사운드

잠근화면으로 보기


메뉴들이 있다. 이때 실제 확인 가능한 이벤트 들은

알림스타일 , 아이콘에 알림 표시, 사운드로 판단 된다.


그래서 위 세가지 설정 값을 확인 할 수 있는 방법은 아래와 같다.

그 중에서도 알림 스타일이 "없음"인 경우에는 Push  메세지를 서버에서 날려도

화면에 나타나지 않는다.


// 앱을 실행시켰을 때 푸시 알람 형태 활성화 설정. 뱃지, 알림창, 사운드
  NSUInteger rntypes = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];


 NSString *pushAlert = 
 (rntypes & UIRemoteNotificationTypeAlert) ? @"enabled" : @"disabled"; //알림스타일 여부 (이 값이 0인 경우 알림 메세지가 보이지 않는다.)

  NSString *pushBadge = 
 (rntypes & UIRemoteNotificationTypeBadge) ? @"enabled" : @"disabled"; //아이콘에 알림 표시 여부

  NSString *pushSound = 
 (rntypes & UIRemoteNotificationTypeSound) ? @"enabled" : @"disabled";  //사운드 설정여부



<APNS 최초 알럿에서 "승인"을 클릭 한 경우와 "미승인"을 클릭 한 경우의 차이점>

아래와 같이 App의 APNS등록 로직이 들어 간 경우,

"승인" 또는 "미승인"에 관계없이 "설정>알림>해당App 설정" 화면은 동일하게 나타난다.


//APNS등록

UIRemoteNotificationType notiType = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound;

if (iOSVersion >= 5) notiType = notiType | UIRemoteNotificationTypeNewsstandContentAvailability;

    

[[UIApplication sharedApplicationunregisterForRemoteNotifications];

[[UIApplication sharedApplicationregisterForRemoteNotificationTypes:notiType];


iOS 디바이스 2대로 각각 테스트 결과, App 최초 설치 후 APNS "승인" 과 "미승인"의 차이점은 

사용자가 최초 "승인"을 클릭 한 경우, 해당App의 알림 스타일이 "배너"로 되어 있었고

사용자가 최초 "미승인"을 클릭 한 경우, 해당App의 알림 스타일이 "없음"으로 되어 있었다.


결국, 최초 APNS승인 여부의 차이는 "승인" 또는 "미승인" 클릭 시, 화면에 알림 메세지를 보여 줄 것이냐 아니냐의 차이였다.

Posted by 다오나무