mattkhaw / cordova-plugin-callkit

Cordova plugin that enables CallKit + PushKit (iOS) & ConnectionService (Android) functionality to display native UI
MIT License
16 stars 47 forks source link

Callkit does not trigger #6

Closed mozhn closed 4 years ago

mozhn commented 4 years ago

As far as I understand from the error I got in Xcode I'm sending the data wrong. Cannot JSON serialize.

Error: [objC] error: -[__NSSingleEntryDictionaryI dataUsingEncoding:]: unrecognized selector sent to instance 0x281c310a0

Incoming data type NSLog(@"Data type: %@", [data class]); result: __NSSingleEntryDictionaryI

The data I send in my PHP script is as follows: $payload = json_encode( array( 'aps' => array('alert' => 'Test'), 'data' => array( 'Caller' => array('Username' => 'user', 'ConnectionId' => 'user1') ) ) );

mattkhaw commented 4 years ago

I've mentioned this before in other closed issues. Just send the payload as a JSON string and not as an object.

mozhn commented 4 years ago

Yes sorry, I must have overlooked it. I fixed the problem.