MicroStrategy ONE

Register a Custom Widget in the Application's Xcode Project in iOS

To register a custom widget in a MicroStrategyMobile-enabled application, do the following:

  1. Create a custom widget and its corresponding style in MicroStrategy Web, as described in Registering a Custom Widget with MicroStrategy Web.

  2. Apply the custom widget to a grid in a document, a described in Applying a Custom Widget to a Report or Report Grid    

  3. Create a link in the vis.plist file between the style assigned for the widget and the code that will render the widget, as described below  

To assign the custom widget class created for the widget to the visualization style assigned for the widget, perform the following steps in Xcode:

  1. In Xcode, open the project for the mobile application in which you want to use the custom widget.  

  2. If you want to keep the out-of-the-box vis.plist file intact, copy the vis.plist file from the out-of-the-box FinalBundle.bundle to the custom FinalBundle.bundle. For instructions of how to create a custom FinalBundle.bundle, refer to Customizing MicroStrategy Mobile SDK Resource Bundles. You can use the search box on the bottom of Xcode’s navigator bar to find the vis.plist file.  

  3. Right-click vis.plist and select Show in Finder. After the Finder window opens, go back to Xcode.  

  4. Select your custom FinalBundle.bundle Resources folder, then select Show in Finder.  

  5. In the out-of-the-box Resources folder, copy the vis.plist file.    

  6. Right-click the Resources folder of the custom FinalBundle.bundle folder and paste the copied vis.plist file. The vis.plist file is now displayed in the custom FinalBundle.bundle.    

  7. Update the custom vis.plist file so that the widget style you registered with the Web Customization Editor maps to the View class you created for your widget in Xcode.    

    1. Under Root, right-click VisualizationStyleNames, then select Add Row.  

    2. Under Key, enter the name of the custom widget style that you registered with MicroStrategy Web.    

    3. Under Value, enter the name of the View class you built for the custom widget in Xcode.  

  8. Save your changes.  

  9. Click Run to compile and deploy the application to a simulator. Confirm that it compiles and deploys successfully. At this point, you should be able to see the widget render on the device when the report/document to which the widget is assigned is displayed.  

To upload the application to a device, set the destination in the scheme to the mobile device and then build and run. For other requirements on deploying to a device, refer to documentation from Apple. You can access useful links to the Apple documentation from the Distributing iPhone or iPad Applications topic.