Skip to content

Commit

Permalink
fixing it finally
Browse files Browse the repository at this point in the history
  • Loading branch information
Shchvova committed Sep 11, 2021
1 parent 56f98df commit 8808e05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Binary file modified plugins/2020.3569/android/plugin.notifications.v2.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
import com.ansca.corona.CoronaRuntime;
import com.ansca.corona.CoronaRuntimeListener;
import com.ansca.corona.CoronaRuntimeTaskDispatcher;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.Tasks;
import com.google.firebase.messaging.FirebaseMessaging;
import com.naef.jnlua.JavaFunction;
import com.naef.jnlua.LuaState;
import com.naef.jnlua.LuaType;
import com.naef.jnlua.NamedJavaFunction;
import java.util.concurrent.TimeUnit;

/**
* Implements the Lua interface for the plugin.
Expand Down Expand Up @@ -262,7 +265,9 @@ public int invoke(final LuaState luaState) {
}
String deviceToken = null;
try {
deviceToken = FirebaseMessaging.getInstance().getToken().getResult();
Task<String> deviceTokenTask = FirebaseMessaging.getInstance().getToken();
Tasks.await(deviceTokenTask, 1000, TimeUnit.MILLISECONDS);
deviceToken = deviceTokenTask.getResult();
} catch (Throwable ex) {
ex.printStackTrace();
}
Expand Down

0 comments on commit 8808e05

Please sign in to comment.