npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@warpsoft/push-notification

v0.0.11

Published

消息推送

Downloads

3

Readme

@warpsoft/push-notification

消息推送

Install

npm install @warpsoft/push-notification
npx cap sync

iOS

Apple 需要在Info.plist文件中指定MobTech的中申请的App标识信息

  • MOBAppKey ---应用对应的 Mob App Secret
  • MOBAppSecret ---应用对应的 Mob App Secret
  • MOBNetLater ---其值为常量 2

需要在Xcode IDE 中配置

Target(App)
  Signing & Capabilities 
    Add Capability 
      Background Modes
        ✓ Remote notifications
      Push Notifications

Android

华为

  • 下载agconnect-services.json 并将其拷贝到应用级根目录下
  • 修改项目级build.gradle
buildscript {
    repositories {
        google()
        jcenter()
+       // 配置HMS Core SDK的Maven仓地址。
+       maven {url 'https://developer.huawei.com/repo/'}
    }
    dependencies {
        ...
+       // 添加agcp插件配置。
+       classpath 'com.huawei.agconnect:agcp:1.6.0.300'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
+       // 配置HMS Core SDK的Maven仓地址。
+       maven {url 'https://developer.huawei.com/repo/'}
    }
} 

Gradle 7.0版本后,“allprojects > repositories”配置已迁移到项目级“settings.gradle”文件中。 “settings.gradle”文件配置示例如下:

dependencyResolutionManagement {
    ...
    repositories {
        google()
        jcenter() 
+       maven {url 'https://developer.huawei.com/repo/'}
    }
}
  • 修改应用级build.gradle 在头部添加啊
+ apply plugin: 'com.huawei.agconnect'
  • 签名文件拷贝到工程的app目录下,在build.gradle文件中配置签名
android {
  ...
+ signingConfigs {
+    release {
+      storeFile file('top_allspark_app.jks')
+      keyAlias 'top_allspark_app'
+      keyPassword '******'
+      storePassword '*****'
+    }
+    debug {
+      storeFile file('top_allspark_app.jks')
+      storePassword '*****'
+      keyAlias 'top_allspark_app'
+      keyPassword '*****'
+    }
+ }
  ...
}
  • 修改AndroidManifest.xml 更换包名 以下的域名部分 如果android:value的值为数字的需要添加$符
    <application>
    ...
+     <meta-data android:name="HUAWEIPUSH_APP_ID" android:value="*******"></meta-data>
    ...
    </application>
+   <uses-permission android:name="android.permission.INTERNET" />
+   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+   <uses-permission android:name="android.permission.VIBRATE"/>

小米

  • 修改AndroidManifest.xml 更换包名 以下的域名部分 如果android:value的值为数字的需要添加$符
    <application>
    ...
+      <meta-data android:name="MIPUSH_APP_ID" android:value="******"></meta-data>
+      <meta-data android:name="MIPUSH_APP_KEY" android:value="******"></meta-data>
    ...
    </application>
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.VIBRATE"/> 
+    <permission android:name="top.allspark.app.permission.MIPUSH_RECEIVE" android:protectionLevel="signature" />
+    <uses-permission android:name="top.allspark.app.permission.MIPUSH_RECEIVE" />

API

grantPrivacy()

grantPrivacy() => Promise<void>

隐私授权


getDeviceToken()

getDeviceToken() => Promise<DeviceInfo>

获取设备Token

Returns: Promise<DeviceInfo>


getPushClickData()

getPushClickData() => Promise<PushData>

获取推送附带信息

Returns: Promise<PushData>


Interfaces

DeviceInfo

设备Token信息

| Prop | Type | Description | | ----------------- | ------------------- | -------------------------- | | brand | string | 手机厂商代码小写 huawei,xiaomi,ios | | deviceToken | string | deviceToken |

PushData

推送消息附带信息,可用于点击通知消息并打开app后转向到特定的页面