morinel / gcmpush

Titanium Module for Android Push
Apache License 2.0
57 stars 35 forks source link

Adding new method #34

Closed kerberosargos closed 8 years ago

kerberosargos commented 8 years ago

Hi, I tried to add new method at GCMModule.java

  @Kroll.method
    public void cancelNotificationById(int notificationId) {
      try
      {

        NotificationManager notificationManager = (NotificationManager) TiApplication.getInstance().getApplicationContext().getSystemService(TiApplication.NOTIFICATION_SERVICE);
        notificationManager.cancel(notificationId);

        Log.i(LCAT, "kedi tebi");
      } catch (Exception ex) {
         Log.e(LCAT, "Cannot cancel notificationId: " + notificationId + " | " + ex.getMessage());
     }
    }

When I call from Appcelerator I am getting error like "GCM hasn o method" I am calling method as below

    var gcm = require("nl.vanvianen.android.gcm");
        gcm.cancelNotificationById(1);

Do you have any idea?

Thank you in advance.

morinel commented 8 years ago

Have you tried ant clean + ant?

kerberosargos commented 8 years ago

I can build module without problem. I can't use this method from my app. 22 Mar 2016 08:58 tarihinde "Jeroen van Vianen" notifications@github.com yazdı:

Have you tried ant clean + ant?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/morinel/gcmpush/issues/34#issuecomment-199667638

morinel commented 8 years ago

Does version >= 1.5 work for you?