capacitor-community / background-geolocation

A Capacitor plugin that sends you geolocation updates, even while the app is in the background.
MIT License
180 stars 56 forks source link

Capacitor 3 not registering pluging automatically #33

Closed ramay2088 closed 2 years ago

ramay2088 commented 2 years ago

Describe the bug I have upgraded from capacitor 2 to capacitor 3 . The issue I am facing on both plugins push notifications and background geolocation . Getting same error that is “Plugin not implemented for android”

According to the docs it should automatically register in MainActivity.java file but that is not happening I have to remove init method from that file

package siloc.xyz;

import android.os.Bundle;

import com.getcapacitor.BridgeActivity;
import com.getcapacitor.Plugin;

import java.util.ArrayList;
import com.hemangkumar.capacitorgooglemaps.CapacitorGoogleMaps;
import com.getcapacitor.community.bglocation.BackgroundGeolocation;
public class MainActivity extends BridgeActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
}

}

To Reproduce I upgraded from capacitor 2 to capacitor 3

Expected behavior It suppose to register these plugins

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information): vivo v2029

diachedelic commented 2 years ago

I would try this: