Search code examples
iosapple-push-notificationsquickblox

'Title' property in Quickblox' APNs payload


It seems like QB doesn't support 'title' sub-field of 'alert' field inside remote notification payload. 'title' sub-field is used to show notification summary on AppleWatch 'Short-Look' interface (not sure if Watch' OS use 'alert' field's content if title field not specified).

Is it possible to add this field or maybe there is some workaround?

ps: my guess: no reason to show "alert" content on short-look interface because it will be showed in static interface (long-look). It's not possible to check this due obvious reason:)

upd: 'alert' won't be used in short-look UI dev forum link


Solution

  • It's possible to disable "automatic" Push notifications in admin panel and send Push notifications manually from sender's side via

    + (QBRequest *)createEvent:(QBMEvent *)event successBlock:(void (^)(QBResponse *, NSArray *))successBlock
                errorBlock:(QBRequestErrorBlock)errorBlock;
    

    In this case we can form arbitrary APNs payload content

    upd: the simplest way is to use:

    + (QBRequest *)sendPush:(QBMPushMessage *)pushMessage toUsers:(NSString *)usersIDs successBlock:(void(^)(QBResponse *response, QBMEvent *event))successBlock errorBlock:(void (^)(QBError *error))errorBlock;