When I add comm.transmit to my connectIQ app, it build with no error but my app Displays "IQ!" exactly after that page. How can I solve this issue? what can be the reason?

When I add comm.transmit to my connectIQ app, it build with no error but my app Displays "IQ!" exactly after that page. How can I solve this issue? what can be the reason? 

This the part of my code related to Communication:

using Toybox.Communications as Comm;

if (Communications has :registerForPhoneAppMessages) {

            Communications.registerForPhoneAppMessages();

        } else if (Communications has :setMailboxListener) {

            Communications.setMailboxListener();

        }

    

    var connectionListener = new TascCommListener();

        try {

            Communications.transmit("Hello", null, connectionListener);

        } catch (ex) {

            System.println(ex.getErrorMessage());

        }

class TascCommListener extends Comm.ConnectionListener{

    static var SUCCESS = 0;

     static var FAILURE = 1;

   hidden var mCallback;

    function initialize(){

    Comm.ConnectionListener.initialize();

     Communications.ConnectionListener.initialize();

    }

     function onComplete() {

         System.println("Transmit Complete");

    }

     function onError() {

          System.println("Transmit Failed");

    }

   }

  • Thanks a lot. I gave the permission and my app doesn't crash anymore and works properly as before. But I don't know why I still do not receive any massage in my phone. On my android code I have this:(I use disc golf example)

    try {

    mConnectIQ.registerForAppEvents(mDevice, mmMyApp, new IQApplicationEventListener() {
    @Override
    public void onMessageReceived(IQDevice iqDevice, IQApp iqApp, List<Object> message, ConnectIQ.IQMessageStatus iqMessageStatus) {
    ((TextView) findViewById(R.id.textView2)).setText("done");
    StringBuilder builder = new StringBuilder();

    if (message.size() > 0) {
    for (Object o : message) {
    builder.append(o.toString());
    // builder.append("\r\n");
    }
    } else {
    builder.append("Received an empty message from the application");
    }

    String received = builder.toString();

    }
    });


    I put the textview "Done" to make sure my app actually receive anything. But it
    doesn't unfortunately.
  • I found app can receive message, but "app.getApplicatoinId()" is empty, and 'appListener' is null, so message can't be callback.