Hello
I am trying to publish a message using PUSH_PUBSUB policy because I want to send the push notification separately
But it is showing following FAULT in error block
FAULT = ‘Server.Processing’ [unable to adapt parameter to a method argument type. unable to adapt string to class com.backendless.messaging.PushPolicyEnum. String value - NONE] <unable to adapt parameter to a method argument type. unable to adapt string to class com.backendless.messaging.PushPolicyEnum. String value - NONE>
below is the code I am using
-(void)publishMessageFromAsync:(NSString *)message from:(NSString *)name
{
DeliveryOptions *deliveryOptions = [DeliveryOptions new];
[deliveryOptions pushPolicy:PUSH_PUBSUB]; // PUSH_ONLY and //PUSH_ALSO works fine
deliveryOptions.pushSinglecast=self.deviceIds;
PublishOptions *publishOptions = [PublishOptions new];
[publishOptions addHeader:@“groupId” value:self.group.objectId];
[publishOptions addHeader:@“type” value:@“message”];
[publishOptions addHeader:@“senderName” value:[CURRENT_USER getProperty:@“firstName”]];
[publishOptions addHeader:@“senderId” value:[CURRENT_USER getProperty:@“objectId”]];
[backendless.messagingService
publish:@“default” message:message.description publishOptions:publishOptions
deliveryOptions:deliveryOptions
response:^(MessageStatus *messageStatus) {
NSLog(@“MessageStatus = %@ <%@>”, messageStatus.messageId, messageStatus.status);
[[NotificationManager sharedInstance] sendMessageNotification:message toGroup:self.group];
}
error:^(Fault *fault) {
NSLog(@“FAULT = %@”, fault);
}
];
}