hapines MYPI

hapines
접속 : 5547   Lv. 66

Category

Profile

Counter

  • 오늘 : 53 명
  • 전체 : 502635 명
  • Mypi Ver. 0.3.1 β
[Unity] NotificationServices.RegisterForRemoteNotificationTypes (0) 2014/04/14 PM 03:00
지금 unity에 push를 붙여야되서 이것저것 찾고 있는데 찾아보니 지원되는 클래스에 이게 있음.
테스트폰중에 2개는 날아왔는데 안날아오는 것이 있어서 native를 손보는 소스를 쓸지 이걸 가져다 쓸지 고민중.

신기해서 남겨둠.

NotificationServices.RegisterForRemoteNotificationTypes

function Start() {
NotificationServices.RegisterForRemoteNotificationTypes(RemoteNotificationType.Alert |
RemoteNotificationType.Badge |
RemoteNotificationType.Sound);
}

function Update () {
if (!tokenSent) {
var token : byte[] = NotificationServices.deviceToken;
if (token != null) {
// send token to a provider
var hexToken : String = "%" + System.BitConverter.ToString(token).Replace('-', '%');
new WWW("http://"+address+"/?token="+hexToken);
tokenSent = true;
}
}
}


PS) 되네.....

신고

 
X