Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

registerDevice for web push notification #1012

Open
mehdimsv opened this issue Jan 22, 2021 · 0 comments
Open

registerDevice for web push notification #1012

mehdimsv opened this issue Jan 22, 2021 · 0 comments

Comments

@mehdimsv
Copy link

mehdimsv commented Jan 22, 2021

Hi
I want to subscribe for getting push notifications, according to telegram official blog I have to use account.registerDevice which in TLsharp currently not implemented.
I used SendRequestAsync to invoke the method, but I get Web_push_key_invalid error.
I don't know what to pass to the Token parameter of the request.
this is my code snippet:
var json = "{\"endpoint\":\"https://www.xxx.com/api/telegram/webpush/1\"," + "\"keys\":{" + "\"p256dh\":\"" + Helper.Base64UrlEncode(publikKey) + "\"," + "\"auth\":\"" + Helper.Base64UrlEncode(auth) + "\"" + "}}"; var tlRequestRegisterDevice = new TLRequestRegisterDevice() {TokenType = 10, Token = json}; var notify = await client.SendRequestAsync<TLMethod>(tlRequestRegisterDevice);

the problem is I don't know what are the parameters publicKey and secret.
is publicKey the one of the key in api development panel?
how about the secret wich passes as "auth" to the request? where can I get this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant