Selam Girma

Selam Girma

1608115320

FlutterNetEase cloud letter SDK

nim_flutter

For FlutterNetEase cloud letter SDK

Current function

  • log in
  • auto login
  • sign out
  • Kick out
  • Get a list of recent conversations
  • Delete a list of recent conversations
  • Open new conversation
  • Close open session
  • Get conversation message
  • Send and receive text, pictures, video, audio messages
  • Send and receive custom messages
  • Mark audio read
  • Call NIMSDKability to record and send voice messages
  • Audio, video and voice (under development)
  • Chat room (under development)
  • Interactive live broadcast (under development)
Group chat is not supported

Some examples

initialization

Before use, first initialize:

void  main () async {
   FlutterNIM (). init (
    appKey :  "123456" ,
    apnsCername :  "ABCDEFG" , // iOS production environment certificate name 
    apnsCernameDevelop :  "ABCDEFG" , // iOS test environment certificate name 
    imAccount :  "123456" ,
    imToken :  "123456" ,
  );

  runApp ( MyApp ());
}

Due to SDK limitations, the Android platform still needs to be initialized in Application, you can refer to the following code:

public  class  MyApplication  extends  FlutterApplication {
     @Override 
    public  void  onCreate () {
         super . onCreate();

        FlutterNIMPreferences . SetContext ( this );
         // SDK initialization (start background service, if user login information already exists, SDK will complete automatic login) 
        NIMClient . Init( this , FlutterNIMPreferences . GetLoginInfo (), buildSDKOptions());
    }

    // NetEase 
    Yunxin configuration (you can also use your own configuration here) private  SDKOptions  buildSDKOptions () {
         return  FlutterNIMSDKOptionConfig . GetSDKOptions( this , " 123456 " , buildMixPushConfig());
    }

    // NetEase 
    Yunxin third-party push configuration private  MixPushConfig  buildMixPushConfig () {

        MixPushConfig config =  new  MixPushConfig ();

        // Xiaomi pushes 
        config . xmAppId =  " 123456 " ;
        config . xmAppKey =  " 123456 " ;
        config . xmCertificateName =  " ABCDEFG " ;

        // Huawei pushes 
        config . HwCertificateName =  " ABCDEFG " ;
         ...

        return config;
    }
}

log in

bool isSuccess =  await  FlutterNIM (). login (imAccount, imToken);

sign out

FlutterNIM (). logout ();

Kick out

FlutterNIM ().kickReasonResponse. listen (( NIMKickReason reason) {
     // Handling the logic of being kicked offline 
});

List of recent conversations

Manually get the list of recent conversations:

FlutterNIM (). loadRecentSessions ();

Listening to recent conversations, manually calling to get the recent conversation list or changes in the recent conversation list (add, update, delete, mark read) will trigger this callback.

FlutterNIM ().recentSessionsResponse. listen ((recentSessions) {
     List < NIMSession > _recentSessions = recentSessions;

    // Here you can calculate the total unread of recent sessions 
    int unreadNum = recentSessions
        . map ((s) => s.unreadCount)
        . fold ( 0 , (curr, next) => curr + next);
    });

Delete a session (only delete the local cache, not the cloud record)

FlutterNIM (). deleteRecentSession (session.sessionId);

Conversation

Start a new conversation

bool isSuccess =  await  FlutterNIM (). startChat (session.sessionId);

Listen for conversation messages

FlutterNIM ().messagesResponse. listen ((messages) {
     List < NIMMessage > _messages = messages;

    // Find the remainder, if the result is equal to zero, there may be more data 
    int _remainder =  this ._messages.length %  20 ;
     bool _hasMoreData = remainder ==  0 ;
    });

When you exit the chat page, you need to close the session

FlutterNIM (). exitChat ();

send messages

// Send text message 
FlutterNIM (). sendText (content);

// Send image message 
FlutterNIM (). sendImage (file.path);

// Send video message 
FlutterNIM (). sendVideo (file.path);

The voice message calls the recording capability of the native Yunxin SDK

// Start recording 
FlutterNIM (). onStartRecording ();

// End the recording and automatically send a voice message 
FlutterNIM (). onStopRecording ();

// Cancel recording, will not send 
FlutterNIM (). onCancelRecording ();

Custom message

Put the custom message content Mapin:

    // Feel free to define 
    Map < String , dynamic > customObject = {
       "type" :  "Custom" ,
       "url" :  "xxx" ,
      ...
    };

    FlutterNIM (). sendCustomMessage (
      customObject,
      apnsContent :  "[A custom message has been sent]" ,
    );

The received custom message body JSONexists NIMMessagein the format of a string customMessageContent, and then parse it by yourself:

final customObjectMap = json. decode (customMessageContent);
 // Custom 
var model =  CustomModel . fromJson (customObjectMap);

This SDK refers to the following author’s work flutter_nim

Download Details:

Author: cls8428181

Source Code: https://github.com/cls8428181/nim_flutter

#flutter #dart #mobile-apps

What is GEEK

Buddha Community

FlutterNetEase cloud letter SDK
Adaline  Kulas

Adaline Kulas

1594162500

Multi-cloud Spending: 8 Tips To Lower Cost

A multi-cloud approach is nothing but leveraging two or more cloud platforms for meeting the various business requirements of an enterprise. The multi-cloud IT environment incorporates different clouds from multiple vendors and negates the dependence on a single public cloud service provider. Thus enterprises can choose specific services from multiple public clouds and reap the benefits of each.

Given its affordability and agility, most enterprises opt for a multi-cloud approach in cloud computing now. A 2018 survey on the public cloud services market points out that 81% of the respondents use services from two or more providers. Subsequently, the cloud computing services market has reported incredible growth in recent times. The worldwide public cloud services market is all set to reach $500 billion in the next four years, according to IDC.

By choosing multi-cloud solutions strategically, enterprises can optimize the benefits of cloud computing and aim for some key competitive advantages. They can avoid the lengthy and cumbersome processes involved in buying, installing and testing high-priced systems. The IaaS and PaaS solutions have become a windfall for the enterprise’s budget as it does not incur huge up-front capital expenditure.

However, cost optimization is still a challenge while facilitating a multi-cloud environment and a large number of enterprises end up overpaying with or without realizing it. The below-mentioned tips would help you ensure the money is spent wisely on cloud computing services.

  • Deactivate underused or unattached resources

Most organizations tend to get wrong with simple things which turn out to be the root cause for needless spending and resource wastage. The first step to cost optimization in your cloud strategy is to identify underutilized resources that you have been paying for.

Enterprises often continue to pay for resources that have been purchased earlier but are no longer useful. Identifying such unused and unattached resources and deactivating it on a regular basis brings you one step closer to cost optimization. If needed, you can deploy automated cloud management tools that are largely helpful in providing the analytics needed to optimize the cloud spending and cut costs on an ongoing basis.

  • Figure out idle instances

Another key cost optimization strategy is to identify the idle computing instances and consolidate them into fewer instances. An idle computing instance may require a CPU utilization level of 1-5%, but you may be billed by the service provider for 100% for the same instance.

Every enterprise will have such non-production instances that constitute unnecessary storage space and lead to overpaying. Re-evaluating your resource allocations regularly and removing unnecessary storage may help you save money significantly. Resource allocation is not only a matter of CPU and memory but also it is linked to the storage, network, and various other factors.

  • Deploy monitoring mechanisms

The key to efficient cost reduction in cloud computing technology lies in proactive monitoring. A comprehensive view of the cloud usage helps enterprises to monitor and minimize unnecessary spending. You can make use of various mechanisms for monitoring computing demand.

For instance, you can use a heatmap to understand the highs and lows in computing visually. This heat map indicates the start and stop times which in turn lead to reduced costs. You can also deploy automated tools that help organizations to schedule instances to start and stop. By following a heatmap, you can understand whether it is safe to shut down servers on holidays or weekends.

#cloud computing services #all #hybrid cloud #cloud #multi-cloud strategy #cloud spend #multi-cloud spending #multi cloud adoption #why multi cloud #multi cloud trends #multi cloud companies #multi cloud research #multi cloud market

Adaline  Kulas

Adaline Kulas

1594166040

What are the benefits of cloud migration? Reasons you should migrate

The moving of applications, databases and other business elements from the local server to the cloud server called cloud migration. This article will deal with migration techniques, requirement and the benefits of cloud migration.

In simple terms, moving from local to the public cloud server is called cloud migration. Gartner says 17.5% revenue growth as promised in cloud migration and also has a forecast for 2022 as shown in the following image.

#cloud computing services #cloud migration #all #cloud #cloud migration strategy #enterprise cloud migration strategy #business benefits of cloud migration #key benefits of cloud migration #benefits of cloud migration #types of cloud migration

Download Android SDK Manager and SDK Tools

In this tutorial, we’ll read about the Android SDK Manager. We will see what is SDK manager in Android and why and how it is important for Android. So, SDK stands for Software Development Kit, which is a collection of software tools required. SDK basically helps Android to download tools and recent versions of Android. Every time a new Android version is released, along with it is released an SDK corresponding to it. This SDK must be installed by the developers for the devices.
What is SDK Manager?
A Software development kit is a set of tools required for the development of applications for Android. It also ensures that the progress of App development goes as flat as pancakes. We need SDK irrespective of the language we are using. Android SDK comes wrapped up with the Android Studio these days. An Android SDK separates the tools, platforms and other components into packages. These can be downloaded from the SDK Manager.

#android tutorials #android sdk manager #android sdk manager download #android sdk tools #android studio sdk manager #sdk download #sdk manager #sdk tools

Google Cloud: Caching Cloud Storage content with Cloud CDN

In this Lab, we will configure Cloud Content Delivery Network (Cloud CDN) for a Cloud Storage bucket and verify caching of an image. Cloud CDN uses Google’s globally distributed edge points of presence to cache HTTP(S) load-balanced content close to our users. Caching content at the edges of Google’s network provides faster delivery of content to our users while reducing serving costs.

For an up-to-date list of Google’s Cloud CDN cache sites, see https://cloud.google.com/cdn/docs/locations.

Task 1. Create and populate a Cloud Storage bucket

Cloud CDN content can originate from different types of backends:

  • Compute Engine virtual machine (VM) instance groups
  • Zonal network endpoint groups (NEGs)
  • Internet network endpoint groups (NEGs), for endpoints that are outside of Google Cloud (also known as custom origins)
  • Google Cloud Storage buckets

In this lab, we will configure a Cloud Storage bucket as the backend.

#google-cloud #google-cloud-platform #cloud #cloud storage #cloud cdn

Zelma  Gerlach

Zelma Gerlach

1619050860

Cloud Operations Overview for Google Cloud Professional Architect

Operations Suite (Stackdriver) is a hybrid monitoring, logging, and diagnostics tool suite for applications on the Google Cloud Platform and AWS.

GCP Purchased Stackdriver and was rebranded to Google Stackdriver after the purchase.

Google has now rebranded the Stackdriver Suite as “Cloud Operations” This is important to know in case the exam has not been updated to reflect the change.

Cloud Operations monitors the clouds service layers in a single SaaS solution. Cloud Operations maintains native integration with Google Cloud data tools BigQuery, Cloud Pub/Sub, Cloud Storage, Cloud Datalab, and out-of-the-box integration with all your other application components.

In a nutshell Cloud Operations Suite allows you to Monitor, troubleshoot, and improve application performance on your Google Cloud environment.

#google-cloud-platform #google-cloud #cloud-computing #cloud-architecture #cloud