PushActionService.uts 590 字节
Newer Older
taohebin@dcloud.io's avatar
taohebin@dcloud.io 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
import Service from 'android.app.Service';
import Intent from 'android.content.Intent';
import IBinder from 'android.os.IBinder';
import { PushManager } from './PushManager.uts';
export class PushActionService extends Service {
	
	constructor(){
		super();
	}
	
	override onBind(intent : Intent) : IBinder | null {
		return null
	}

	override onStartCommand(intent : Intent | null, flag : Int, startId : Int) : Int {
		if (intent != null) {
			PushManager.getInstance().processAction(this.getBaseContext(), intent)
		}
		return super.onStartCommand(intent, flag, startId)
	}
}