Java를 사용하여 APNS 서버와 통신하는 것처럼 Enhanced Notification Format (Apple Push Notification Service로 보내기)의 Expiry 필드에있는 4 바이트가 의미하는 바를 명확히 알 수 있습니까? 예를 들어 Date 객체를 준비했다면 APNS로 보내는데 필요한 4 바이트로 어떻게 가져올 수 있습니까?(Java) Date 개체의 만료 필드를 Apple Push Notification Services로 보내려면 어떻게해야합니까?
3
A
답변
1
APNS 문서 상태 :
유효 -A 고정 UNIX 에포크 날짜는 통지가 더 이상 유효하지 않으며 폐기 할 때 가 식별 초 (UTC)로 표현. 만기 값은 네트워크 순서 (big endian) 여야합니다. 만료 값이 양수이면 APN은 적어도 알림을 전달하려고 시도합니다. 0보다 작은 값이나 0보다 작은 값을 지정하여 APN에 알림을 저장하지 않도록 요청할 수 있습니다.
:
당신이 날짜 개체가 귀하의 메시지가 만료해야하는 날짜/시간을 보관 유지합니다 (date
를 호출 할 수 있습니다) 경우, 만료의 4 바이트가 APNS에 보낼 수는 expiry
의 가치입니다
Calendar cal = Calendar.getInstance();
cal.setTime (date);
int expiry = cal.getTimeInMillis()/1000L;
또는 상대 만료 간격을 가질 수 있습니다. 예를 들어 APNS 서버로 전송 된 후 메시지가 2 시간 (7200 초) 만료되도록하려면 expiry
의 값은
int expiry = (System.currentTimeMillis()/1000L) + 7200;
이됩니다.
관련 문제
- 1. Apple Push Notification, java-apns의 PKCS12
- 2. Apple Push Notification 서비스 통계 (apns)
- 3. Apple Push Notification 인증서의 중요한 변경 사항
- 4. Apple Push Notification 서비스 공급자가 ASP에 있습니까?
- 5. Apple Push Notification Service with Python
- 6. 프로그래밍 방식으로 Apple Push Notification 스타일 변경
- 7. Apple Push Notification 용 APNS Openss 연결?
- 8. Apple Push Notification Provider (자체 응용 프로그램)
- 9. PHP Apple Enhanced Notification
- 10. Java를 통한 Apple Push Notification Server와의 SSL 핸드 셰이크
- 11. Apple Push 알림을 디버깅하려면 어떻게해야합니까?
- 12. (Push Notification) 안드로이드
- 13. Apple Push Notification 샌드 박스를 가상 장치로 사용하는 방법?
- 14. Apple Push Notification in Erlang (또는 Ruby에서 개선 되었습니까?)
- 15. Apple Push Notification 인증서를 고객 사이트에 배포하는 방법
- 16. Apple Push Notification Service - 알림 메시지 제목 변경
- 17. Apple Push Notification 서비스는 UDP 또는 TCP를 사용합니까?
- 18. 서버에서 클라이언트로 알림을 전송하는 Apple Push Notification 이외의 옵션이 있습니까?
- 19. APPLE IOS Notification with .NET
- 20. Apple Push Notifications를 사용하여 통행권을 업데이트하는 방법
- 21. 푸시 알림 (Push Notification) 위임자가 호출되지 않음
- 22. Apple Push Message
- 23. Apple Push Notification이 전달되지 않았습니다.
- 24. 메트로 외부 Windows Push Notification Services 사용
- 25. Apple Push Notifcation 서비스의 문제점
- 26. Apple Push Notifications 특정 사용자
- 27. 푸시 알림 서버에 사용할 언어 Apple Push Notification Server에 대한 소켓 스트림 연결 유지
- 28. Apple Push Notification 서비스에서 ios 4, ios 5 및 ios6의 변경 사항이 있습니까?
- 29. Azure 응용 프로그램에서 Apple Push Notification 기능이없는 MonoTouch (iPhone) 응용 프로그램으로 푸시 메시지