3

I would like to know what is the default behaviour of silent push notifications when the app is on foreground. Will it still display an alert view or not?

When localising the alert message :

"alert" : {
            "body" : "Start the game Jenna"
            "loc-key" : "start.game",
            "loc-args" : [ "Jenna"]
 }

Does the body message takes precedence over the loc-key? What if the loc-key does not exist on the app?

2

2 Answers 2

4

The docs imply that it's either/or: you should either set the body or the loc-key / loc-args properties.

Apple docs.

They might fall back to body if loc-key is not found, or they might never even look it up in Localizable.strings when body is present. Since docs don't define it, I would not count on the behavior one way or the other.

Sign up to request clarification or add additional context in comments.

Comments

1

Just tested setting both body_loc_key and body

If the client doesn't have body_loc_key in it's Localizable.strings it will show the body text otherwise it will show the localized string of body_loc_key

Which is just what I want and probably what you would expect.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.