0

I have launch screen that is storyboard launch file. And when i start my app it is shown. But now i want to add when i open my app from remote notification to show different splash. In notification payload it is possible to specify field launch image. And i have specified image.

But even though i specify my launch image, the default launch image is shown, the one from storyboard launch. Is it possible to do this, to have a different launch images, if i use launch storyboard file?

MegaManX
  • 8,766
  • 12
  • 51
  • 83
  • Hi, did you find a solution? – ofer2980 Jun 08 '16 at 04:01
  • This is not possible if you are using launch storyboard. If you want to have different splashes for notifications, you'll have to define images for all the phones you support. – MegaManX Jun 08 '16 at 10:46
  • Got you :( Thanks! – ofer2980 Jun 08 '16 at 21:16
  • Hi again, I replaced my lauchScreen xib file with a static image - one set for the default and another one for the push. The problem is it still doesn't work - it keeps using the default static image, although I do get in the push payload (at the right level in the dicationary) + the image is present at the bundle (I have tried both options - adding the images as (another) launch image set, or adding it as regular file, to the project tree) Any idea? That's really strange... – ofer2980 Jun 11 '16 at 20:17
  • Yeah basically you can't add them as bundle or even in image assets folder. You have to have them as files, and you have them manually named, appropriate for each phone and interface orientation - for example iPhone 6+ portrait is imageName-414w-736h@3x~iphone.png, ofcourse push will be just named imageName, and system will do the rest – MegaManX Jun 13 '16 at 18:27
  • NP, you are welcome, i just looked at your profile, i didn't know it was you Ofer ;-) The thing is I researched this when i was doing it for Rounds ;-) – MegaManX Jun 14 '16 at 22:39
  • Ahh, same here! Funny! :) – ofer2980 Jun 15 '16 at 14:09

1 Answers1

3

It's not possible until current version ,iOS9.

Besides,you can only get your remote notification after - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions being called when you launch your app.

jiangjiefs
  • 149
  • 11
  • Interesting, but before i started using storyboard launch image, and just launch catalog, i could do it... – MegaManX Jan 12 '16 at 15:41
  • really? how could you make it. I'm very glad to know that.:> – jiangjiefs Jan 12 '16 at 15:50
  • just specify image in application payload http://stackoverflow.com/questions/18657631/can-i-send-an-image-with-apples-push-notification-service – MegaManX Jan 12 '16 at 15:52
  • i see.this can be done when your app is in background mode, not when you launch your app. – jiangjiefs Jan 12 '16 at 16:03
  • not really, it can be also done when you launch your app from background notification – MegaManX Jan 12 '16 at 18:11
  • Buddy you are right.I have tested the way you provide. It works as you said. But can not be done when I set launch image into launch storyboard. – jiangjiefs Jan 13 '16 at 02:58