通過NodeJs JPush實現安卓的異地登陸

2021-07-15 20:54:57 字數 1172 閱讀 2276

因公司業務需要,需要實現乙個異地登陸然後下線的功能,說的可能有點糊塗,可以先看下實現的效果圖:

安裝jpush(極光)的nodejs版

廢話就不多說,直接就上**吧!

npm install jpush-sdk
}npm install

npm install 後加 --registry 

.org info underscore

var jpush =

require("../lib/jpush/jpush.js");

client.push().setplatform(jpush.

all)

.setaudience(jpush.

all)

+new

date().tolocalestring(), null, 1, ))

.send(function(err, res) else

});

由於我這裡只用到了安卓端,所以notification裡我只設定了安卓端的,其它引數就不解釋了,具體的引數詳情可以檢視官方api文件

public

class

extends

@override

public

void

oncreate()

}

@override

protected

void

onresume()

private

void

processpushmessage(context context, bundle bundle)

string extras = bundle.getstring(jpushinte***ce.extra_extra);

try

} catch (jsonexception e)

}

通過SharedPreference實現共享資料

如果程式b想要訪問程式a的sharedpreference可以通過下面的語句來實現 try catch namenotfoundexception e sharedpreferences sp acontext.getsharedpreferences preferences name,contex...

通過Terracotta實現Tomcat集群(2)

配置terracotta雙機熱備 1 配置terracotta tc config.xml user.home terracotta server data user.home terracotta server logs user.home terracotta server statistics...

乘法通過查表實現

本文主要通過小學學的99乘法表實現 乘法原始實現.cpp 定義控制台應用程式的入口點。include stdafx.h include include include using namespace std int array result 10 10 int getcount int num re...