통지에 가입 할 때 데이터를 전달해야하므로 Module_07_04_iOSNativePush 앱에서 예제 코드를 가져 와서 다음 코드를 ViewController.m에 추가했습니다.) :Worklight iOS 알림 용 WLPush를 사용하여 구독시 데이터 전달
NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:
@"userName", @"DoronK",
@"password", @"testPwd", nil];
id pushit = [WLPushOptions new];
[pushit addSubscriptionParameter:@"test" :@"Test1"];
[pushit addSubscriptionParameters:dic];
[[WLPush sharedInstance] subscribe:readyToSubscribeListener.alias: pushit :connectListener];
이 오류가 발생하지만, 내가 예제 PushAdapter 코드를 실행할 때,이 사용하여 어댑터에 추가하지 않습니다
이var usub = 'json:'+JSON.stringify(userSubscription);
...
return { result: "Notification sent to user :: " + userId +
", wait " + waittime + " before sending another. UserSub:" + usub};
어댑터의 결과는 다음과 같습니다
를{
"isSuccessful": true,
"result": "Notification sent to user :: worklight, wait 0 before sending another.
UserSub:json:{\"userId\":\"worklight\",\"state\":{}}"
}
내가 "state"아래의 사전을 통해 전달한 변수를 기대합니까? 어댑터에 [WLPush subscribe] 호출에서 전달 된 매개 변수를 가져 오는 다른 방법이 있습니까?
아마도 내가 알 수 있듯이 Objective C에 새로운 기능이 추가되어 있으므로 구독 통화가 제대로 이루어진 것으로 가정하지 마십시오. 또한 Worklight Studio 6을 픽스 팩 1과 함께 사용하고 있습니다.
를 참조하십시오? – DavidW