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


Java ErrorCode.SUCCESS属性代码示例

本文整理汇总了Java中com.xiaomi.mipush.sdk.ErrorCode.SUCCESS属性的典型用法代码示例。如果您正苦于以下问题:Java ErrorCode.SUCCESS属性的具体用法?Java ErrorCode.SUCCESS怎么用?Java ErrorCode.SUCCESS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.xiaomi.mipush.sdk.ErrorCode的用法示例。


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

示例1: onReceiveRegisterResult

@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
    Log.v(DemoApplication.TAG,
            "onReceiveRegisterResult is called. " + message.toString());
    String command = message.getCommand();
    List<String> arguments = message.getCommandArguments();
    String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
    String log;
    if (MiPushClient.COMMAND_REGISTER.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mRegId = cmdArg1;
            //Log.d("register","success");
            //log = context.getString(R.string.register_success);
        } else {
            //log = context.getString(R.string.register_fail);
        }
    } else {
        //log = message.getReason();
    }

    /*Message msg = Message.obtain();
    msg.obj = log;
    DemoApplication.getHandler().sendMessage(msg);*/
}
 
开发者ID:NicoLiutong,项目名称:miaosou,代码行数:24,代码来源:DemoMessageReceiver.java

示例2: onReceiveRegisterResult

@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
    Log.v(MYTAG,
            "onReceiveRegisterResult is called. " + message.toString());
    String command = message.getCommand();
    List<String> arguments = message.getCommandArguments();
    String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
    String log;
    if (MiPushClient.COMMAND_REGISTER.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            deviceMiToken = cmdArg1;
            Log.v(MYTAG,
                    "小米推送token:" + deviceMiToken);
        } else {
            Log.v(MYTAG,
                    "小米推送注册失败!" );
        }
    } else {
        log = message.getReason();
    }

}
 
开发者ID:heipidage,项目名称:GcmForMojo,代码行数:22,代码来源:MiPushReceiver.java

示例3: onReceiveRegisterResult

@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
    Log.v(MyApplication.TAG, "onReceiveRegisterResult is called. " + message.toString());
    String command = message.getCommand();
    List<String> arguments = message.getCommandArguments();
    String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
    String log;
    if (MiPushClient.COMMAND_REGISTER.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mRegId = cmdArg1;
            log = context.getString(R.string.register_success);
        } else {
            log = context.getString(R.string.register_fail);
        }
    } else {
        log = message.getReason();
    }

    Message msg = Message.obtain();
    msg.obj = log;
    MyApplication.getHandler().sendMessage(msg);
}
 
开发者ID:liuyongfeng90,项目名称:JKCloud,代码行数:22,代码来源:MessageReceiver.java

示例4: onReceiveRegisterResult

@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
	//注意:本回调在非主UI线程
	Log4jLog.d(LONG_TAG, "onReceiveRegisterResult is called. " + message.toString());
	
    String command = message.getCommand();
    List<String> arguments = message.getCommandArguments();
    String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
    String log;
    if (MiPushClient.COMMAND_REGISTER.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mRegId = cmdArg1;
            log = "register_success, mRegId = " + mRegId;
            
            ThirdPartyPushHelper.pushToken = mRegId;
            ThirdPartyPushHelper.setPushToken(true);
        } else {
            log = "register_fail: " + message.getReason();
        }
    } else {
        log = message.getReason();
    }
    
    Log4jLog.d(LONG_TAG, log);
}
 
开发者ID:entboost,项目名称:EntboostIM,代码行数:25,代码来源:XiaoMiPushReceiver.java

示例5: onCommandResult

@Override
public void onCommandResult(Context context, MiPushCommandMessage message) {
    String command = message.getCommand();
    Log.d(TAG,"onCommandResult => " + message.toString());
    List<String> arguments = message.getCommandArguments();
    String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
    String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
    if (MiPushClient.COMMAND_REGISTER.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mRegId = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_SET_ALIAS.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mAlias = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_UNSET_ALIAS.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mAlias = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_SUBSCRIBE_TOPIC.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mTopic = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_UNSUBSCRIBE_TOPIC.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mTopic = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_SET_ACCEPT_TIME.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mStartTime = cmdArg1;
            mEndTime = cmdArg2;
        }
    }
}
 
开发者ID:joyrun,项目名称:MixPush,代码行数:34,代码来源:MiPushMessageReceiver.java

示例6: onCommandResult

@Override
public void onCommandResult(Context context, MiPushCommandMessage message) {
    Log.v(MyApplication.TAG,
            "onCommandResult is called. " + message.toString());
    String command = message.getCommand();
    List<String> arguments = message.getCommandArguments();
    String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
    String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
    String log;
    if (MiPushClient.COMMAND_REGISTER.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mRegId = cmdArg1;
            log = context.getString(R.string.register_success);
        } else {
            log = context.getString(R.string.register_fail);
        }
    } else if (MiPushClient.COMMAND_SET_ALIAS.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mAlias = cmdArg1;
            log = context.getString(R.string.set_alias_success, mAlias);
        } else {
            log = context.getString(R.string.set_alias_fail, message.getReason());
        }
    } else if (MiPushClient.COMMAND_UNSET_ALIAS.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mAlias = cmdArg1;
            log = context.getString(R.string.unset_alias_success, mAlias);
        } else {
            log = context.getString(R.string.unset_alias_fail, message.getReason());
        }
    } else if (MiPushClient.COMMAND_SET_ACCOUNT.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mAccount = cmdArg1;
            log = context.getString(R.string.set_account_success, mAccount);
        } else {
            log = context.getString(R.string.set_account_fail, message.getReason());
        }
    } else if (MiPushClient.COMMAND_UNSET_ACCOUNT.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mAccount = cmdArg1;
            log = context.getString(R.string.unset_account_success, mAccount);
        } else {
            log = context.getString(R.string.unset_account_fail, message.getReason());
        }
    } else if (MiPushClient.COMMAND_SUBSCRIBE_TOPIC.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mTopic = cmdArg1;
            log = context.getString(R.string.subscribe_topic_success, mTopic);
        } else {
            log = context.getString(R.string.subscribe_topic_fail, message.getReason());
        }
    } else if (MiPushClient.COMMAND_UNSUBSCRIBE_TOPIC.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mTopic = cmdArg1;
            log = context.getString(R.string.unsubscribe_topic_success, mTopic);
        } else {
            log = context.getString(R.string.unsubscribe_topic_fail, message.getReason());
        }
    } else if (MiPushClient.COMMAND_SET_ACCEPT_TIME.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mStartTime = cmdArg1;
            mEndTime = cmdArg2;
            log = context.getString(R.string.set_accept_time_success, mStartTime, mEndTime);
        } else {
            log = context.getString(R.string.set_accept_time_fail, message.getReason());
        }
    } else {
        log = message.getReason();
    }
    MainActivity.logList.add(0, getSimpleDate() + "    " + log);

    Message msg = Message.obtain();
    msg.obj = log;
    MyApplication.getHandler().sendMessage(msg);
}
 
开发者ID:liuyongfeng90,项目名称:JKCloud,代码行数:75,代码来源:MessageReceiver.java

示例7: onReceiveRegisterResult

@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage miPushCommandMessage) {
    Logger.d(TAG, "command result");
    String command = miPushCommandMessage.getCommand();
    List<String> arguments = miPushCommandMessage.getCommandArguments();
    final String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);

    if (MiPushClient.COMMAND_REGISTER.equals(command)) {
        if (miPushCommandMessage.getResultCode() == ErrorCode.SUCCESS && BizLogic.isLogin()) {
            if (StringUtil.isBlank(MainApp.PREF_UTIL.getString(Constant.XIAOMI_TOKEN))) {
                MainApp.PREF_UTIL.putString(Constant.XIAOMI_TOKEN, cmdArg1);
            }
            TalkClient.getInstance().getTalkApi()
                    .postToken(cmdArg1)
                    .subscribeOn(Schedulers.io())
                    .observeOn(AndroidSchedulers.mainThread())
                    .subscribe(new Action1<Object>() {
                        @Override
                        public void call(Object o) {
                            MainApp.PREF_UTIL.putString(Constant.XIAOMI_TOKEN, cmdArg1);
                            Logger.d(TAG, "xiaomi push register success: " + cmdArg1);
                        }
                    }, new Action1<Throwable>() {
                        @Override
                        public void call(Throwable throwable) {
                            Logger.e(TAG, "xiaomi push  register", throwable);
                        }
                    });
        }
    }
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:31,代码来源:XiaomiPushReceiver.java

示例8: onCommandResult

/**
 * 接收客户端向服务器发送命令消息后返回的响应
 *
 * @param context
 * @param message
 */
@Override
public void onCommandResult(Context context, MiPushCommandMessage message) {
    String command = message.getCommand();
    List<String> arguments = message.getCommandArguments();
    String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
    String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
    if (MiPushClient.COMMAND_REGISTER.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mRegId = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_SET_ALIAS.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mAlias = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_UNSET_ALIAS.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mAlias = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_SUBSCRIBE_TOPIC.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mTopic = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_UNSUBSCRIBE_TOPIC.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mTopic = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_SET_ACCEPT_TIME.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mStartTime = cmdArg1;
            mEndTime = cmdArg2;
        }
    }
}
 
开发者ID:idisfkj,项目名称:HightCopyWX,代码行数:39,代码来源:WXMessageReceiver.java

示例9: onReceiveRegisterResult

/**
     * 接受客户端向服务器发送注册命令消息后返回的响应
     *
     * @param context
     * @param message
     */
    @Override
    public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
        String command = message.getCommand();
        List<String> arguments = message.getCommandArguments();
        String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
        String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
        if (MiPushClient.COMMAND_REGISTER.equals(command)) {
            if (message.getResultCode() == ErrorCode.SUCCESS) {
                mRegId = cmdArg1;
            }
        }
//        Log.d("TAG", "register:" + mRegId);
        SPUtils.putString("regId", mRegId).commit();
    }
 
开发者ID:idisfkj,项目名称:HightCopyWX,代码行数:20,代码来源:WXMessageReceiver.java

示例10: onReceiveRegisterResult

/**
 * 获取给服务器发送注册命令的结果,结果封装在MiPushCommandMessage类中
 */
@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
    String command = message.getCommand();
    List<String> arguments = message.getCommandArguments();
    String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
    String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
    if (MiPushClient.COMMAND_REGISTER.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mRegId = cmdArg1;
        }
    }
}
 
开发者ID:beanu,项目名称:smart-farmer-android,代码行数:15,代码来源:MiMessageReceiver.java

示例11: onReceiveRegisterResult

/**
 * 用来接受客户端向服务器发送注册命令消息后返回的响应
 *
 * @param context
 * @param message
 */
@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
    Logger.v(TAG + "onReceiveRegisterResult" + message.toString());
    String command = message.getCommand();
    List<String> arguments = message.getCommandArguments();
    String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
    String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
    if (MiPushClient.COMMAND_REGISTER.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mRegId = cmdArg1;
        }
    }
}
 
开发者ID:arieshao,项目名称:Integration,代码行数:19,代码来源:PushReceiver.java

示例12: onCommandResult

/**
 * 用来接收客户端向服务器发送命令消息后返回的响应
 *
 * @param context
 * @param message
 */
@Override
public void onCommandResult(Context context, MiPushCommandMessage message) {
    Logger.v(TAG + "onCommandResult" + message.toString());
    String command = message.getCommand();
    List<String> arguments = message.getCommandArguments();
    String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
    String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
    if (MiPushClient.COMMAND_REGISTER.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mRegId = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_SET_ALIAS.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mAlias = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_UNSET_ALIAS.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mAlias = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_SUBSCRIBE_TOPIC.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mTopic = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_UNSUBSCRIBE_TOPIC.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mTopic = cmdArg1;
        }
    } else if (MiPushClient.COMMAND_SET_ACCEPT_TIME.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mStartTime = cmdArg1;
            mEndTime = cmdArg2;
        }
    }
}
 
开发者ID:arieshao,项目名称:Integration,代码行数:40,代码来源:PushReceiver.java

示例13: onReceiveRegisterResult

@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
    String command = message.getCommand();
    if (MiPushClient.COMMAND_REGISTER.equals(command)) {
        if (mRemoteMessageSDKStateHandler != null) {
            mRemoteMessageSDKStateHandler.onReceiveRegisterResult(message.getResultCode() == ErrorCode.SUCCESS);
        }
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            updateContent(context, context.getString(R.string.msg_push_binded));
        } else {
            updateContent(context, "注册失败,错误码:" + message.getResultCode());
        }
    }
}
 
开发者ID:legendmohe,项目名称:LEHomeMobile_android,代码行数:14,代码来源:RemoteMessageReceiver.java

示例14: onCommandResult

@Override
public void onCommandResult(Context arg0, MiPushCommandMessage message) {
    String command = message.getCommand();
    List<String> arguments = message.getCommandArguments();
    String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
    if (MiPushClient.COMMAND_REGISTER.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            MyApplication.Push_Reg_ID = cmdArg1;
        } else {
            MyApplication.Push_Reg_ID = "";
        }
    } else {
        MyApplication.Push_Reg_ID = "";
    }
}
 
开发者ID:csuyzb,项目名称:AndroidLinkup,代码行数:15,代码来源:MessageReceiver.java

示例15: onCommandResult

@Override
public void onCommandResult(Context context, MiPushCommandMessage message) {

    String command = message.getCommand();
    List<String> arguments = message.getCommandArguments();
    String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
    String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
    String log;
    if (MiPushClient.COMMAND_REGISTER.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mRegId = cmdArg1;
            //log = context.getString(R.string.register_success);
        } else {
            //log = context.getString(R.string.register_fail);
        }
    } else if (MiPushClient.COMMAND_SET_ALIAS.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mAlias = cmdArg1;
            //log = context.getString(R.string.set_alias_success, mAlias);
        } else {
            //log = context.getString(R.string.set_alias_fail, message.getReason());
        }
    } else if (MiPushClient.COMMAND_UNSET_ALIAS.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mAlias = cmdArg1;
            //log = context.getString(R.string.unset_alias_success, mAlias);
        } else {
            //log = context.getString(R.string.unset_alias_fail, message.getReason());
        }
    } else if (MiPushClient.COMMAND_SET_ACCOUNT.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mAccount = cmdArg1;
            //log = context.getString(R.string.set_account_success, mAccount);
        } else {
            //log = context.getString(R.string.set_account_fail, message.getReason());
        }
    } else if (MiPushClient.COMMAND_UNSET_ACCOUNT.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mAccount = cmdArg1;
            //log = context.getString(R.string.unset_account_success, mAccount);
        } else {
            //log = context.getString(R.string.unset_account_fail, message.getReason());
        }
    } else if (MiPushClient.COMMAND_SUBSCRIBE_TOPIC.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mTopic = cmdArg1;
            //log = context.getString(R.string.subscribe_topic_success, mTopic);
        } else {
            //log = context.getString(R.string.subscribe_topic_fail, message.getReason());
        }
    } else if (MiPushClient.COMMAND_UNSUBSCRIBE_TOPIC.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mTopic = cmdArg1;
            //log = context.getString(R.string.unsubscribe_topic_success, mTopic);
        } else {
            //log = context.getString(R.string.unsubscribe_topic_fail, message.getReason());
        }
    } else if (MiPushClient.COMMAND_SET_ACCEPT_TIME.equals(command)) {
        if (message.getResultCode() == ErrorCode.SUCCESS) {
            mStartTime = cmdArg1;
            mEndTime = cmdArg2;
            //log = context.getString(R.string.set_accept_time_success, mStartTime, mEndTime);
        } else {
            //log = context.getString(R.string.set_accept_time_fail, message.getReason());
        }
    } else {
        //log = message.getReason();
    }
    //MainActivity.logList.add(0, getSimpleDate() + "    " + log);

    /*Message msg = Message.obtain();
    msg.obj = log;
    DemoApplication.getHandler().sendMessage(msg);*/
}
 
开发者ID:NicoLiutong,项目名称:miaosou,代码行数:74,代码来源:DemoMessageReceiver.java


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