OneSignal-Cordova-SDK
OneSignal-Cordova-SDK copied to clipboard
Wrong type definition of OneSignal.postNotification() jsonData parameter
OneSignal Cordova SDK version 3.0.1
The type definition says that notification data is passed as string:
https://github.com/OneSignal/OneSignal-Cordova-SDK/blob/5372e152c5057c30f65bd3506f07995b50214015/types/OneSignalPlugin.d.ts#L189-L196
However, the iOS native code expects NSDictionary
https://github.com/OneSignal/OneSignal-Cordova-SDK/blob/5372e152c5057c30f65bd3506f07995b50214015/src/ios/OneSignalPush.m#L307-L310
OneSignal.postNotification
definition (OneSignal iOS SDK v3.9.1 as mentioned in release notes of OneSignal Cordova SDK v3.0.1):
https://github.com/OneSignal/OneSignal-iOS-SDK/blob/fd06483b314f842c16e0a6f74dfb27a04dc7df66/iOS_SDK/OneSignalSDK/Source/OneSignal.h#L502-L504
#pragma mark Post Notification
+ (void)postNotification:(NSDictionary* _Nonnull)jsonData;
+ (void)postNotification:(NSDictionary* _Nonnull)jsonData onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock;
Could you please fix this type definition?
Thank you for reporting this @dmitry-salnikov,
We are making some typescript changes and this definition will be fixed.