2014-09-08 1 views
2

내 사용자에게 알림을 보내고 싶습니다 (백그라운드에서 수신 - 알림, 사운드 또는 배지가 아님). Xcode의 백그라운드 모드에서 원격 알림 옵션을 확인했습니다.내 앱에서 자동 알림을 사용하려면 원격 알림에 등록해야합니까?

내 질문은 - [UIApplication sharedApplication] registerForRemoteNotificationTypes을 사용하여 원격 알림을 등록해야합니까? 그렇다면 어떤 유형을 사용해야합니까? 그들 중 누구도 "자동 알림 '과 같은하지 :

  • UIRemoteNotificationTypeNone
  • UIRemoteNotificationTypeBadge
  • UIRemoteNotificationTypeSound
  • UIRemoteNotificationTypeAlert
  • UIRemoteNotificationTypeNewsstandContentAvailability

이 작업을 수행하는 올바른 방법은 무엇입니까?

을하지만 다음 빈 사운드 파일과 같은 전송 통지에 백엔드 개발자에게 문의 :

답변

-2

그래 당신은 그것을 할 수

{ 
"aps" : { 
    "sound" : "nothiong.cif" 
} 
} 

그것은 소리없이 알림을 표시합니다.

참고 : 사운드 파일은 앱 번들에 있어야하지 않습니다.

+0

registerForRemoteNotificationTypes를 사용해야합니까? – YogevSitton

+0

예. 당신은해야합니다. 그렇지 않으면 기본 알림 소리가 표시됩니다. [[UIApplication sharedApplication] registerForRemoteNotificationTypes : (UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)]; – PREMKUMAR

+0

Xcode에서 Capabilities-> Background Modes-> Remote Notification 섹션의 목적은 무엇입니까 - 여전히 알림을 등록해야하는 경우? – YogevSitton

관련 문제