I see that for "views support" an auto-increment field was added to the pn tokens table. This is useful for other things besides Views but would be even more useful if it was included in all the hooks.

For hook_push_notifications_store_token(&$token, $type_id, $uid) perhaps passing token object with all the token properties would be better than passing individual properties.

Comments

liquidcms created an issue. See original summary.

liquidcms’s picture

ahh, i see though that the hook_push_notifications_store_token() hook is before the token is stored; so we don't ey have a "token id". I am trying to attach token id to an entity but can't do that until i have id value (i.e. after token is stored).

perhaps i need a patch to add a hook after token is stored.

[and then will need a views relationship to link token to my entity via this id]

liquidcms’s picture

Status: Active » Needs review
StatusFileSize
new1.16 KB

this adds a post store hook

haagendazs’s picture

Assigned: Unassigned » haagendazs
Status: Needs review » Reviewed & tested by the community

That's a great suggestion. I couldn't apply the patch directly, but applied the code manually and modified the documentation in push_notifications.api.php.

  • haagendazs committed 748e644 on 7.x-1.x
    Issue #2574349 by liquidcms, haagendazs: Expose database record in hook...
haagendazs’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.