2

Hope you are well. I want to add iMessage Stickers to my app. My app created in Android Studio using LibGDX/RoboVM. So, I can't add Stickers extension directly to my project. I have signed .ipa as output from Android Studio after building with RoboVM. I have created a single standalone project in Xcode with my app's bundle id, added the Stickers extension, then have done the following.

In the terminal

  1. Unzipped the .ipa using "unzip MyApp.ipa".
  2. Removed the _CodeSignature folder using "rm -rf Payload/MyApp.app/_CodeSignature/"
  3. Copied and Pasted the Stickers extension to the "Payload/MyApp.app/"
  4. Copied and Pasted the provisioning profile using "cp MyDistributionProfile.mobileprovision Payload/MyApp.app/embedded.mobileprovision"
  5. Signed again using "codesign -f -s "iPhone Distribution: MyCompany INC" --entitlements Entitlements.plist Payload/MyApp.app"
  6. Zipped using "zip -qr MyResignedApp.ipa Payload/".

After this, I tried to upload the MyResignedApp.ipa via ApplcationLoader from XCode and did not get any error during upload.

The problem is that I received the rejection email, where they said the following,

This bundle is invalid - The Info.plist file for /Payload/MyApp.app/Sticker Pack.stickerpack is missing or could not be read.

The Info.plist exists and here is it.

<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
 "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>new_stickers</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME_)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
    <key>NSExtensionPointIdentifier</key>
    <string>com.apple.message-payload-provider</string>
    <key>NSExtensionPrincipalClass</key>
    <string>StickerBrowserViewController</string>
</dict>

Any suggestions what I'm doing wrong? Many Many thanks.

Gag Baghdasaryan
  • 716
  • 1
  • 11
  • 22

1 Answers1

1

You `Copied and Pasted the Stickers extension to the "Payload/MyApp.app/" but extension has to be located in "Payload/MyApp.app/PlugIns".

MobiVM natively supports packing and signing extension out of the box. And it is not required to manual repacking/signing.

But you have to build app extension in Xcode within standalone project, then reference extension in robovm.xml like bellow:

 <appExtensions>
     <extension profile="3AED05A9-5F1F-4120-9276-11980B9C88EE">OneSignalNotificationServiceExtension</extension>
 </appExtensions>

To build it in Xcode easies way is to add extension target to empty project. Then build it separately from command line using xcode-build:

xcodebuild -project onesignal.xcodeproj -target OneSignalNotificationServiceExtension -configuration release -sdk iphoneos -arch arm64 -arch armv7 -arch armv7s BUILD_DIR=build BUILD_ROOT=build
xcodebuild -project onesignal.xcodeproj -target OneSignalNotificationServiceExtension -configuration release -sdk iphonesimulator -arch i386 -arch x86_64 BUILD_DIR=build BUILD_ROOT=build

and pack into fat binary using lipo.

lipo -create -output "OneSignalNotificationServiceExtension.appex/OneSignalNotificationServiceExtension" \
    "build/release-iphoneos/OneSignalNotificationServiceExtension.appex/OneSignalNotificationServiceExtension" \
    "build/release-iphonesimulator/OneSignalNotificationServiceExtension.appex/OneSignalNotificationServiceExtension"

Also in case of stickers extension RoboVM copies following to IPA:

  • MessagesApplicationExtensionSupport/MessagesApplicationExtensionStub
  • MessagesApplicationSupport/MessagesApplicationStub

Which might be missing when you do repacking manually.

There is a tutorial for MobiVM how to use app extension which provide more details about each step.

dkimitsa
  • 256
  • 1
  • 3
  • Hello. Thank you a lot for your answer. Looking into it now. Will let you know updates. Thanks) – Gag Baghdasaryan Mar 20 '19 at 16:26
  • I have followed the steps that are in the tutorial. In the last step, I have added the following to my Robovm.xml file. ` Plugins new_stickers ` Now, what should I do? I'm not sure if I should just build my Robovm project, as I think, that I must do something with the new_stickers folder :D – Gag Baghdasaryan Mar 20 '19 at 17:17
  • I assume you have built you stickers extension and got `stickers.appex`. (btw, there is Stickers Pack App template in Xcode which make it event simpler to produce) Then in RoboVM: 1) -- specifies location of `stickers.appex` in respect to project root, e.g. if you put it in `libs/` -- then specify just ` libs` 2) refer to it in section ` stickers `. May attention that its without .appex extension – dkimitsa Mar 20 '19 at 20:49
  • then run it or create IPA as usual – dkimitsa Mar 20 '19 at 20:49
  • That's worked @dkimitsa. Thank you a lot. Now I can run on my device and see the stickers. But, when I try to upload the .ipa to the TestFlight, I'm receiving the following Rejection message from Apple. Invalid Messages Application Extension Support. The files MessagesApplicationExtensionStub don’t match myAPP.app/PlugIns/newstickers.appex/MessagesApplicationExtensionStub. Make sure the files are correct, rebuild your app, and resubmit it. Don’t apply post-processing to myAPP.app/PlugIns/newstickers.appex/MessagesApplicationExtensionStub. What am I doing wrong? – Gag Baghdasaryan Mar 21 '19 at 10:05
  • what version of mobivm are you using ? Have tried with 2.3.6 and it was accepted for iTunes (And I did no manual repacking of ipa) – dkimitsa Mar 22 '19 at 13:17
  • Works like a charm. Thank you for your help. – Gag Baghdasaryan Mar 23 '19 at 19:46