vfarafonov/idea-intent-sender-plugin

Plugin doesn't work

Closed this issue · 3 comments

Hi. I tried this plugin with GCM and start activity (main activity), but nothing happened. I think terminal output would be great in your plugin

Hi.
Adding terminal output to TODO list same as readme updating with more accurate instructions.
I will do this in a few days.
Thanks for feedback.

Cannot update readme right now so here it is couple examples of how to use plugin:

  1. Imagine that MessageActivity should be launched and MessageActivity picks up message id from intent inside its onCreate (id type is long and extra Key is “messge_id”).
    Component picker can be used to get MessageActivity’s full component name and fill User field. Component name should be like “com.some.package/.activities.MessageActivity”. After that required extra should be added and it is only left to press “Start Activity” button and check out launched MessageActivity on device with defined message opened.
    You can also check it using logging: Log.d(LOG_TAG, "Message id: " + getIntent().getLongExtra("messageId", -1));
    !!!!! Note plugin may have troubles on some devices (confirmed for some devices from Samsung) when activity is not exported
  2. Imagine that class GcmBroadcastReceiver is created for GCM messages handling and json stored in a String with Key “message” expected.
    GcmBroadcastReceiver will be registered in manifest with permission android:permission="com.google.android.c2dm.permission.SEND". Unfortunately this permission will block adb command and we have to remove it during tests.
    Intent filter for GcmBroadcastReceiver:
To send test GCM we need to set Action as “com.google.android.c2dm.intent.RECEIVE”, add String extra with key “message_type” and value “gcm”, add one more String extra “message” with expected json as value and click on “Send Broadcast” button. App will handle sent broadcast message as it will handle real GCM message.

Done with terminal output feature so you can update plugin to 0.3.0 (automatically from IDEA or manually) and check it out.