1
페블 시계에 알림을 보내려고합니다.페블에 알림 보내기
public void sendPebble(String title, String body) {
final Intent i = new Intent("com.getpebble.action.SEND_NOTIFICATION");
final Map<String, String> data = new HashMap<String, String>();
data.put("title", title);
data.put("body", body);
final JSONObject jsonData = new JSONObject(data);
final String notificationData = new JSONArray().put(jsonData).toString();
i.putExtra("messageType", "PEBBLE_ALERT");
i.putExtra("sender", "Test");
i.putExtra("notificationData", notificationData);
Log.d("Test", "Sending to Pebble: " + notificationData);
sendBroadcast(i);
}
내가 로그 캣에서 메시지를 받고 있어요,하지만 시계에 아무런 통지 : 나는 기본적으로 the example from the website입니다이 코드를 사용하고 있습니다. 절차가 충분히 단순 해 보였습니다. 내가 놓친 너무 명백한 것이 있습니까? 아니면 설명서가 불완전한 것입니까?
편집 : 명백한 질문 :
:
- 가 네, 시계가 연결되어
- 예, 내가 가진 타사 알림이 내 문제이고,
확실하지 않은 매니 페스트 파일에서'com.getpebble.action.SEND_NOTIFICATION'을 선언해야한다고 생각합니다 ... –
제대로 이해한다면 수신 클래스 만이해야합니다. –