如何在Go服务器中直接获取客户端令牌以进行推送通知测试

huangapple go评论146阅读模式
英文:

How to directly get client token in go server for push notification testing

问题

推送通知的常见方式是从客户端获取令牌,然后将该令牌传递给服务器端,最后服务器使用该令牌发送用户想要的任何通知。但是出于测试目的,没有实际的客户端设备,如何从服务器端获取模拟令牌呢?

英文:

The common way to push notification is get the token from client side, and then pass this token to the server side, finally server use this token to send any notification user want. But for test purpose, there is no actually client device, how to get the mock token from server side?

答案1

得分: 1

@mohax的答案是正确的。我想再补充一点:

如果没有客户端设备请求令牌,你无法获取推送令牌。但是你可以使用HMS ToolkitCloud Debugging来测试你的应用程序。

对于Android Studio上的华为模拟器,你可以安装HMS Toolkit。作为一个轻量级的IDE工具插件,HMS Toolkit实现了应用程序的创建、编码、转换、调试、测试和发布。HMS Toolkit提供了云调试功能,让你可以在远程真实设备上对你的应用程序进行24/7不间断的测试。通过这个功能,你可以随时随地了解华为设备上应用程序的运行状态,即使没有可用设备、设备类型不完整或无法重现错误。

每次可以在单个设备上使用云调试功能2小时。在有效期到期之前,你可以释放设备并重新申请设备。

关于如何使用HMS Toolkit和云调试的详细指导,请参考这个链接

英文:

@mohax's answer is correct. I'd like to add a little more:

You cannot get push token without client device request for token. But you can use HMS Toolkit or Cloud Debugging to test your app.

For Huawei emulator on Android Studio, you can install HMS Toolkit. As a lightweight IDE tool plugin, HMS Toolkit implements app creation, coding, conversion, debugging, test, and release. HMS Toolkit provides Cloud Debugging for you to perform 24/7 uninterrupted testing on your app running on remote real devices. With this function, you can learn about the running status of apps on Huawei devices anytime and anywhere even if no device is available, device types are not completed, or an error cannot be reproduced.

Cloud Debugging can be used on a single device for 2 hours each time. Before the validity period expires, you can release the device and apply for the device again.

For more detail about the guidance of how to use HMS Toolkit and cloud debugging,You can also refer this link.

huangapple
  • 本文由 发表于 2021年5月18日 20:52:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/67586591.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定