Hi,
You can use service class to initialize your app credentials inside custom-code and send push to your app users. You can write any logic on the top of the custom code and yes we do have another example as well. Please have a look at this link in which Custom code is written for fetching the user profile from Google, Facebook, GitHub etc based on their access token.
Please have a look at above mentioned custom code and let me know if you required any help from my side.
We will be Happy to assist you!!!
Regards,
Himanshu Sharma