当前位置: 首页>>代码示例>>Java>>正文


Java Push类代码示例

本文整理汇总了Java中com.codename1.push.Push的典型用法代码示例。如果您正苦于以下问题:Java Push类的具体用法?Java Push怎么用?Java Push使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Push类属于com.codename1.push包,在下文中一共展示了Push类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onMain_SendPushAction

import com.codename1.push.Push; //导入依赖的package包/类
@Override
protected void onMain_SendPushAction(Component c, ActionEvent event) {
    String dest = findDestinationDevice(c).getText();
    if(dest.equals("")) {
        dest = null;
    }
    boolean prod = findProductionEnvironement(c).isSelected();
    String googleServerKey = findGoogleServerKey(c).getText();
    String iOSCertURL = findIosCert(c).getText();
    String iOSCertPassword = findIosPassword(c).getText();
    String bbPushURL = findBbPushURL(c).getText();
    String bbAppId = findBbAppId(c).getText();
    String bbPassword = findBbPassword(c).getText();
    String bbPort = findBbPort(c).getText();
    Push.sendPushMessage(TOKEN, findPushMessage(c).getText(), dest, prod, googleServerKey, iOSCertURL, iOSCertPassword, bbPushURL, bbAppId, bbPassword, bbPort);    
}
 
开发者ID:codenameone,项目名称:codenameone-demos,代码行数:17,代码来源:StateMachine.java

示例2: start

import com.codename1.push.Push; //导入依赖的package包/类
public void start() {
    if(current != null){
        current.show();
        return;
    }
    showLoginForm();

    // let the login form show before we register the push so the permission screen doesn't appear on a white
    // background
    Display.getInstance().callSerially(() -> {
        // registering for push after the UI appears
        Hashtable args = new Hashtable();
        args.put(com.codename1.push.Push.GOOGLE_PUSH_KEY, GCM_SENDER_ID);        
        Display.getInstance().registerPush(args, true);        
    });
}
 
开发者ID:codenameone,项目名称:codenameone-demos,代码行数:17,代码来源:SocialChat.java

示例3: onMain_SendPushAction

import com.codename1.push.Push; //导入依赖的package包/类
@Override
protected void onMain_SendPushAction(Component c, ActionEvent event) {
    String dest = findDestinationDevice(c).getText();
    if(dest.equals("")) {
        dest = null;
    }
    boolean prod = findProductionEnvironement(c).isSelected();
    String googleServerKey = findGoogleServerKey(c).getText();
    String iOSCertURL = findIosCert(c).getText();
    String iOSCertPassword = findIosPassword(c).getText();
    String bbPushURL = findBbPushURL(c).getText();
    String bbAppId = findBbAppId(c).getText();
    String bbPassword = findBbPassword(c).getText();
    String bbPort = findBbPort(c).getText();
    Push.sendPushMessage(findPushMessage(c).getText(), dest, prod, googleServerKey, iOSCertURL, iOSCertPassword, bbPushURL, bbAppId, bbPassword, bbPort);    
}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:StateMachine.java

示例4: registerForPush

import com.codename1.push.Push; //导入依赖的package包/类
public void registerForPush() 
{
    Hashtable meta = new Hashtable();
    meta.put(com.codename1.push.Push.GOOGLE_PUSH_KEY, "49326842176");        
    Display.getInstance().registerPush(meta, true);
    
    Log.p("Push: Register");
}
 
开发者ID:martijn00,项目名称:MusicPlayerCodenameOne,代码行数:9,代码来源:PushManager.java

示例5: registeredForPush

import com.codename1.push.Push; //导入依赖的package包/类
public void registeredForPush(String deviceId) {
    Dialog.show("Push Registered", "Device ID: " + deviceId + "\nDevice Key: " + Push.getPushKey(), "OK", null);
    String k = Push.getPushKey();
    if(k != null) {
        s.findDeviceKey().setText("Device Key: " + k);
    }
    
    Message m = new Message(Push.getPushKey());
    Display.getInstance().sendMessage(new String[] {"[email protected]"}, "Push key", m);
}
 
开发者ID:codenameone,项目名称:codenameone-demos,代码行数:11,代码来源:PushDemo.java

示例6: beforeMain

import com.codename1.push.Push; //导入依赖的package包/类
@Override
protected void beforeMain(Form f) {
    String k = Push.getPushKey();
    if(k != null) {
        findDeviceKey(f).setText("Device Key: " + k);
    }
}
 
开发者ID:codenameone,项目名称:codenameone-demos,代码行数:8,代码来源:StateMachine.java

示例7: registeredForPush

import com.codename1.push.Push; //导入依赖的package包/类
public void registeredForPush(String deviceId) {
    Dialog.show("Push Registered", "Device ID: " + deviceId + "\nDevice Key: " + Push.getDeviceKey() , "OK", null);
    String k = Push.getDeviceKey();
    if(k != null) {
        s.findDeviceKey().setText("Device Key: " + k);
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:8,代码来源:PushDemo.java

示例8: beforeMain

import com.codename1.push.Push; //导入依赖的package包/类
@Override
protected void beforeMain(Form f) {
    String k = Push.getDeviceKey();
    if(k != null) {
        findDeviceKey(f).setText("Device Key: " + k);
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:8,代码来源:StateMachine.java

示例9: registeredForPush

import com.codename1.push.Push; //导入依赖的package包/类
public void registeredForPush(String deviceId) {
    Dialog.show("Push Registered", "Device ID: " + deviceId + "\nDevice Key: " + Push.getDeviceKey() , "OK", null);
    
    Log.p("Push: Registered " + deviceId);
}
 
开发者ID:martijn00,项目名称:MusicPlayerCodenameOne,代码行数:6,代码来源:PushManager.java

示例10: onMain_RegisterForPushAction

import com.codename1.push.Push; //导入依赖的package包/类
@Override
protected void onMain_RegisterForPushAction(Component c, ActionEvent event) {
    Hashtable meta = new Hashtable();
    meta.put(com.codename1.push.Push.GOOGLE_PUSH_KEY, findGoogleProjectId(c).getText());        
    Display.getInstance().registerPush(meta, true);
}
 
开发者ID:codenameone,项目名称:codenameone-demos,代码行数:7,代码来源:StateMachine.java

示例11: onMain_RegisterForPushAction

import com.codename1.push.Push; //导入依赖的package包/类
@Override
protected void onMain_RegisterForPushAction(Component c, ActionEvent event) {
    Hashtable meta = new Hashtable();
    meta.put(com.codename1.push.Push.GOOGLE_PUSH_KEY, findGoogleProjectId(c));        
    Display.getInstance().registerPush(meta, true);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:7,代码来源:StateMachine.java


注:本文中的com.codename1.push.Push类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。