mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-01-12 22:50:20 +08:00
Merge branch 'master' into perf
This commit is contained in:
@@ -36,6 +36,9 @@ android {
|
||||
}
|
||||
productFlavors {
|
||||
}
|
||||
lintOptions {
|
||||
disable 'GradleCompatible'
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.gradle.buildFinished { buildResult ->
|
||||
@@ -68,7 +71,8 @@ rootProject.gradle.buildFinished { buildResult ->
|
||||
logger.log(LogLevel.ERROR, "| |")
|
||||
logger.log(LogLevel.ERROR, " ----------------------------------------------------------- ")
|
||||
}
|
||||
} catch (Exception exception) {}
|
||||
} catch (Exception exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,4 +2,6 @@
|
||||
package="io.invertase.firebase">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
</manifest>
|
||||
|
||||
@@ -174,7 +174,11 @@ public class RNFirebaseLinks extends ReactContextBaseJavaModule implements Activ
|
||||
|
||||
// Looks at the internals of the link data to detect whether it's an invitation or not
|
||||
private boolean isInvitation(PendingDynamicLinkData pendingDynamicLinkData) {
|
||||
return FirebaseAppInvite.getInvitation(pendingDynamicLinkData) != null;
|
||||
FirebaseAppInvite invite = FirebaseAppInvite.getInvitation(pendingDynamicLinkData);
|
||||
if (invite != null && invite.getInvitationId() != null && !invite.getInvitationId().isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private DynamicLink.Builder getDynamicLinkBuilder(final ReadableMap linkData) {
|
||||
|
||||
@@ -36,6 +36,7 @@ import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -357,6 +358,21 @@ public class RNFirebaseNotificationManager {
|
||||
notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
||||
if (schedule.containsKey("repeatInterval")) {
|
||||
// If fireDate you specify is in the past, the alarm triggers immediately.
|
||||
// So we need to adjust the time for correct operation.
|
||||
if (fireDate < System.currentTimeMillis()) {
|
||||
Calendar newFireDate = Calendar.getInstance();
|
||||
Calendar currentFireDate = Calendar.getInstance();
|
||||
currentFireDate.setTimeInMillis(fireDate);
|
||||
|
||||
newFireDate.add(Calendar.DATE, 1);
|
||||
newFireDate.set(Calendar.HOUR_OF_DAY, currentFireDate.get(Calendar.HOUR_OF_DAY));
|
||||
newFireDate.set(Calendar.MINUTE, currentFireDate.get(Calendar.MINUTE));
|
||||
newFireDate.set(Calendar.SECOND, currentFireDate.get(Calendar.SECOND));
|
||||
|
||||
fireDate = newFireDate.getTimeInMillis();
|
||||
}
|
||||
|
||||
Long interval = null;
|
||||
switch (schedule.getString("repeatInterval")) {
|
||||
case "minute":
|
||||
|
||||
Reference in New Issue
Block a user