SimulatorRemoteNotifications icon indicating copy to clipboard operation
SimulatorRemoteNotifications copied to clipboard

Updated notification payload size for iOS >= 8

Open Dev-iL opened this issue 10 years ago • 3 comments

Hello! First of all, I'd like to thank you for this nice tool!

I'm trying to simulate some notifications on an iOS 9 device, which supports a new payload size limit of either 2KB or 4KB. However, SimulatorRemoteNotification seems to truncate the payload after a certain amount of bytes (256?), which results in the following error:

SimulatorRemoteNotification: error = Error Domain=NSCocoaErrorDomain Code=3840
"Unterminated string around character 313." UserInfo={NSDebugDescription=Unterminated
 string around character 313.}

I tried multiplying the values of the following constants by 8, but this seemed to have no effect:

UIApplication+SimulatorRemoteNotifications.m\SimulatorRemoteNotificationsBufferLength
ACSimulatorRemoteNotificationsService.m\SimulatorRemoteNotificationsServiceBufferLength

How can the code be modified to support the increased payload size?

P.S. I know the payload I'm testing is valid because it gets delivered successfully through APNS when testing with a real device.

(Edit: updated the link to the documentation where the payload size is discussed)

Dev-iL avatar Oct 04 '15 18:10 Dev-iL

@Dev-iL I tried changing SimulatorRemoteNotificationsBufferLength in both UIApplication+SimulatorRemoteNotifications.m and ACSimulatorRemoteNotificationsService.m to 2048 and was able to successfully receive larger payloads.

Maybe try cleaning your project / deleting your derived data before rebuilding?

panupan avatar Jul 03 '16 22:07 panupan

@panupan I'll try it again. Did you also try it with the 4KB payload alternative?

Dev-iL avatar Jul 10 '16 11:07 Dev-iL

@Dev-iL Nope, only tried with 2KB which was working perfectly.

panupan avatar Jul 14 '16 01:07 panupan