Initialization
import com.wepin.android.loginlib.WepinLogin;WepinLoginOptions wepinLoginOptions = new WepinLoginOptions(this, appId, appKey);WepinLogin wepinLogin = new WepinLogin(wepinLoginOptions);wepinLogin.init()Example
public class MainActivity extends ComponentActivity {
private WepinLogin wepinLogin;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_example_main);
String appId = getResources().getString(R.string.wepin_app_id);
String appKey = getResources().getString(R.string.wepin_app_key);
WepinLoginOptions wepinLoginOptions = new WepinLoginOptions(this, appId, appKey);
wepinLogin = new WepinLogin(wepinLoginOptions);
// Call initialize function
CompletableFuture<Boolean> res = wepinLogin.init();
res.whenComplete((infResponse, error) -> {
if (error == null) {
System.out.println("infResponse: " + infResponse);
} else {
// render error UI
}
});
}
}isInitialized
Last updated
Was this helpful?