Developers
April 22, 2015
0

WWChat allows third party developers to integrate their own apps or games with the IN-GAME, IN-APP feature, linking public pages where users can register and do messaging.

This feature can also be used by developers to provide assistance, i.e. a support chat wall.

Chat implementation is quite easy, just provide a Button or and ImageButton  like in this example:

imgChat.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View view) {
        if (!appInstalled("com.WWChat")) {
            final Dialog dialog = new Dialog(google_plus.this, R.style.TransparentProgressDialog);
            dialog.setContentView(R.layout.wwdialog_yes_no);
            TextView titletext = (TextView) dialog.findViewById(R.id.wwdialog_title);
            titletext.setText(R.string.Warning);
            TextView text = (TextView) dialog.findViewById(R.id.wwdialog_text);
            text.setText(R.string.Needs_to_Install_WWChat);

            Button dialogButtonYES = (Button) dialog.findViewById(R.id.wwdialog_Positive_Button);

            dialogButtonYES.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {
                    dialog.dismiss();
                    Intent i = new Intent(Intent.ACTION_VIEW);
                    i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.WWChat"));
                    startActivity(i);
               }
            });
            Button dialogButtonNO = (Button) dialog.findViewById(R.id.wwdialog_Negative_Button);

            dialogButtonNO.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {
                     dialog.dismiss();
                }
            });
            dialog.show();
        } else {

            Uri uri_group = Uri.parse("WWChat://group/WeedWorld%20THE%20Game");
            startActivity(new Intent(Intent.ACTION_VIEW, uri_group));
       }
    }
});

private boolean appInstalled(String uri) {
     PackageManager pm = getPackageManager();
     boolean app_installed = false;
     try {
         pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
         app_installed = true;
     } catch (PackageManager.NameNotFoundException e) {
         app_installed = false;
     }
     return app_installed;
}

To check if chat is available, you can do:

if (!appInstalled("com.WWChat")) {
    // APP NOT INSTALLED ...

Then you can follow the example if you want to provide a direct link to Google Play, or another app store you desire.

If chat is available, call the intent:

            Uri uri_group = Uri.parse("WWChat://group/TheNameOfYourChatRoom");
            startActivity(new Intent(Intent.ACTION_VIEW, uri_group));

Of course, you must first:
1) Login to WWChat
2) Create your own public group (important: give password “public” to make it public)

Calling the intent, use the proper HTML syntax, to avoid problems, like in the example:
WWChat://group/WeedWorld%20THE%20Game” is for “WWChat://group/WeedWorld THE Game

We give you this service is for FREE, no need of registration.

Be sure to follow WWChat privacy guidelines, users and chat rooms not following our privacy policy will be banned and removed with no further notice.

Service is offered under the MIT license, that means:

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANT-ABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.