Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove sendNewPlaceNotification http call #90

Merged
merged 3 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
mv app/build/outputs/apk/release/*.apk .

- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: YourSpace APK
path: YourSpace*.apk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@ import com.google.android.libraries.places.api.model.Place
import com.google.android.libraries.places.api.net.PlacesClient
import com.google.android.libraries.places.api.net.SearchByTextRequest
import com.google.firebase.firestore.FirebaseFirestore
import com.google.firebase.functions.FirebaseFunctions
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.tasks.await
import timber.log.Timber
import javax.inject.Inject

class ApiPlaceService @Inject constructor(
private val db: FirebaseFirestore,
private val placesClient: PlacesClient,
private val functions: FirebaseFunctions
private val placesClient: PlacesClient
) {

private val spaceRef = db.collection(Config.FIRESTORE_COLLECTION_SPACES)
Expand Down Expand Up @@ -65,18 +62,6 @@ class ApiPlaceService @Inject constructor(
settings.forEach { setting ->
spacePlacesSettingsRef(spaceId, place.id).document(setting.user_id).set(setting).await()
}

val data = mapOf(
"spaceId" to spaceId,
"placeName" to name,
"createdBy" to createdBy,
"spaceMemberIds" to spaceMemberIds
)
functions.getHttpsCallable("sendNewPlaceNotification").call(data).addOnSuccessListener {
Timber.d("Notification sent successfully")
}.addOnFailureListener {
Timber.e(it, "Failed to send new place notification")
}
}

suspend fun joinUserToExistingPlaces(
Expand Down
Loading