Skip to content

融云即时通讯 cordova-RongCloud的 ionic2 @ionic-native 封装📦(融云 RongCloud 是国内首家专业的即时通讯云服务提供商,专注为互联网、移动互联网开发者提供即时通讯基础能力和云端服务。通过融云平台,开发者不必搭建服务端硬件环境,就可以将即时通讯、实时网络能力快速集成至应用中。)

License

Notifications You must be signed in to change notification settings

Devon3818/cordova-plugin-rongcloud-im-ionic2

Repository files navigation

cordova-plugin-rongcloud-im-ionic2

cordova-plugin-rongcloud-im的ionic2 ionic-native封装

Installation

Install the Cordova and Ionic Native plugins:

ionic cordova plugin add cordova-plugin-rongcloud-im

 
Alternatively, you can install the latest version of the plugin directly from git:

ionic cordova plugin add https://github.com/rongcloud/cordova-plugin-rongcloud-im

Supported platforms

  • Android
  • iOS

The plugin is available via a global variable named RongCloudLibPlugin. It exposes the following properties and functions.

All functions accept optional success and failure callbacks as their final two arguments, where the failure callback will receive an error string as an argument unless otherwise noted.

Usage

The dist directory will contain a sub directory @ionic-native with all the packages compiled in there. Copy the package(s) you created/modified to your app's node_modules under the @ionic-native directory. (e.g. cp -r dist/@ionic-native/plugin-name ../my-app/node_modules/@ionic-native/).

⚠️⚠️ 将 dist/@ionic-native 的 rongcloud文件夹复制到 ionic2项目的 node_modules/@ionic-native/ 下

Add Plugins to Your App's Module

After installing a plugin’s package, add it to your app’s NgModule.


...

import { RongCloudLibPlugin } from '@ionic-native/rongcloud';

...

@NgModule({
  ...

  providers: [
    ...
    RongCloudLibPlugin
    ...
  ]
  ...
})
export class AppModule { }

import { RongCloudLibPlugin } from '@ionic-native/rongcloud';

constructor(private rongcloud: RongCloudLibPlugin) { }

init(){
    this.rongcloud.init({appKey: "yourappKey"}).then((result)=>{
      if (result.status == 'success'){
        .....
      }
    });
}

connect(){
    this.rongcloud.connect({
      token: "yourtoken"
    }).then((ret)=>{

      alert( JSON.stringify(ret) );

    });
}

getCurrentUserId(){
    this.rongcloud.getCurrentUserId().then((ret)=>{
		alert( JSON.stringify(ret) );
	})
}

............

...


** RongCloud IMLib Plugin for Cordova: **

*⚠️⚠️ cordova-plugin-rongcloud-im-ionic2只是将cordova-plugin-rongcloud-im封装到ionic2的@ionic-native,更多的 API 可以查看 cordova-plugin-rongcloud-im ,如有任何问题请到cordova-plugin-rongcloud-im提交issues

About

融云即时通讯 cordova-RongCloud的 ionic2 @ionic-native 封装📦(融云 RongCloud 是国内首家专业的即时通讯云服务提供商,专注为互联网、移动互联网开发者提供即时通讯基础能力和云端服务。通过融云平台,开发者不必搭建服务端硬件环境,就可以将即时通讯、实时网络能力快速集成至应用中。)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published