Skip to content

Commit

Permalink
update utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Mak Moinee committed Aug 14, 2024
1 parent 2d933cd commit 447770d
Show file tree
Hide file tree
Showing 4 changed files with 264 additions and 5 deletions.
252 changes: 252 additions & 0 deletions .idea/other.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ android {
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0.1-rc6"
versionName "1.0.1-rc7"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ project.afterEvaluate {
aar(MavenPublication) {
groupId 'com.github.MakMoinee'
artifactId 'library'
version '1.0.1-rc6'
version '1.0.1-rc7'

artifact bundleReleaseAar
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;

import com.github.MakMoinee.library.models.FirestoreRequestBody;
import com.google.firebase.messaging.FirebaseMessaging;
import com.google.firebase.messaging.RemoteMessage;

Expand Down Expand Up @@ -37,7 +38,7 @@ public static boolean isAlphaNumeric(String s) {
public static String getCurrentDate(String pattern) {
Date currentDateTime = new Date();

if(pattern.isEmpty()){
if (pattern.isEmpty()) {
pattern = "yyyy-MM-dd hh:mm a";
}

Expand All @@ -51,12 +52,11 @@ public static String getCurrentDate(String pattern) {
}

/**
*
* @param title
* @param body
* @param token
*/
public static void sendMessage(String title, String body, String token){
public static void sendMessage(String title, String body, String token) {
// Obtain the FirebaseMessaging instance
FirebaseMessaging firebaseMessaging = FirebaseMessaging.getInstance();

Expand All @@ -72,4 +72,11 @@ public static void sendMessage(String title, String body, String token){
// Send the FCM message
firebaseMessaging.send(messageBuilder.build());
}

public static FirestoreRequestBody createBody(Map<String, Object> data) {
FirestoreRequestBody body = new FirestoreRequestBody.FirestoreRequestBodyBuilder()
.setParams(data)
.build();
return body;
}
}

0 comments on commit 447770d

Please sign in to comment.