We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My code.
package com.linkgroup;
import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import me.leolin.shortcutbadger.Badger; import me.leolin.shortcutbadger.ShortcutBadger; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import android.util.Log;
public class BadgeModule extends ReactContextBaseJavaModule {
private final ReactApplicationContext reactContext; private Boolean applyAutomaticBadger; private ComponentName componentName; private static final String LOG_TAG = "BadgeAndroid"; public BadgeModule(ReactApplicationContext reactContext) { super(reactContext); this.reactContext = reactContext; } @Override public String getName() { return "BadgeAndroid"; } @ReactMethod public void setBadge(int number) { Log.d(LOG_TAG, "setting count: " + number); Context context = getReactApplicationContext(); if (null == componentName) { componentName = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName()).getComponent(); } ShortcutBadger.applyCount(context, number); Log.d(LOG_TAG, "setting count666: " + number); }
}
Can you give me a solution ?
The text was updated successfully, but these errors were encountered:
@solomen5555 I think it should be ApplicationContext and not ReactApplicationContext.
ApplicationContext
ReactApplicationContext
Sorry, something went wrong.
No branches or pull requests
My code.
package com.linkgroup;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import me.leolin.shortcutbadger.Badger;
import me.leolin.shortcutbadger.ShortcutBadger;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import android.util.Log;
public class BadgeModule extends ReactContextBaseJavaModule {
}
Can you give me a solution ?
The text was updated successfully, but these errors were encountered: