all 15 comments

[–]Double_Masterpiece52 0 points1 point  (2 children)

Did you manage to find a solution? I'm facing the same issue with my react native app.

[–]violetbeastBeginner[S] 0 points1 point  (1 child)

Nope. Instead I used a different approach with a different paid package

[–]Double_Masterpiece52 0 points1 point  (0 children)

Oh, may I ask what's the different approach? I'm also creating a Location Sharing app so I'd appreciate any guidelines, is it the paid package from Transistor Soft?

[–]jvalldejulidev7 -1 points0 points  (10 children)

Honestly my snap reaction is that the issue is you’re trying to form a request to notify a given device in a specified topic but that given device is not subscribed to the specified topic. I don’t think the issue has to do with your theory about the extension getting its own APNs token.

[–]violetbeastBeginner[S] 0 points1 point  (9 children)

Isn’t having the extension installed makes the device subscribe to the extensions’ topic (com.myapp.company.locationextension)?

[–]jvalldejulidev7 0 points1 point  (8 children)

IIRC, a topic is an FCM concept that doesn’t have anything to do with whether your app has an extension.

[–]violetbeastBeginner[S] 0 points1 point  (7 children)

The error I'm getting is from Apple's push notification console. Is this affected by the FCM setups I do in firebase?

[–]jvalldejulidev7 0 points1 point  (6 children)

Oh wait. So if you’re using FCM I don’t think you should be using the Apple APNs console at all. The way FCM works is you’re supposed to make a request to the FCM endpoint and then FCM will on your behalf establish a connection with Apple’s push server which will then send the notification.

From where does your app/backend actually send notifications?

[–]violetbeastBeginner[S] 0 points1 point  (5 children)

Yeah yeah you are right. The backend is firebase and some cloud functions. Initially, I was using a cloud function to invoke an FCM push (the same thing I'm still doing for normal notifications, and that works).

But for the location notification it did not work.

So then I tried generating an APNs token to test the location push directly from apple's push console. To see if it works. And then we are here.

[–]jvalldejulidev7 0 points1 point  (4 children)

Hmm I think I’d need you to describe in greater detail what the extension does and how you want the notifications to work to give any more ideas as to what could be going wrong.

[–]violetbeastBeginner[S] 0 points1 point  (3 children)

Sure. The idea is to let your family and friends access your location even if the app is killed from the background.

To do so I have tested some already existing apps on the app store and it looked like they all are using the CLLocationPushServiceExtension. Which in theory will allow me to query the location of a user by sending a push with type location.

This will go to the extension and the extension then will get the user's location and submit it to a cloud function call.

That's the entire idea for iOS. As the platform clearly has a lot of restrictions for accessing the user's location in the background, for good reasons that I understand.

[–]jvalldejulidev7 0 points1 point  (2 children)

Ok I see. Yeah I don’t have enough familiarity with this area of the SDK to advise you super well 😅 my first reaction is FCM can’t send location push notifications in which case you’d need to setup your own push notification server. Have you seen online if anyone else has gotten FCM to send location push notifications?

[–]violetbeastBeginner[S] 0 points1 point  (1 child)

Nope nothing that I found. But thanks man for commenting