Welcome to the documentation for the MDMGiftAppActivity iOS framework! This framework allows you to integrate gifting functionality into your iOS app with ease. In this guide, we will walk you through the installation, setup, and usage of this framework. Let’s get started!
Table of Contents
Installation
Follow these steps to install the MDMGiftAppActivity framework in your Xcode project:
- Open your project in Xcode.
- Navigate to the “File” menu and select “Swift Packages” -> “Add Package Dependency”.
-
Enter the repository URL
https://github.com/mdmgiftappactivity
and click “Next”. - Select the latest version of the MDMGiftAppActivity framework and click “Next”.
- In the “Add to Target” section, ensure your app target is selected and click “Finish”.
Setup
Before you can start using the MDMGiftAppActivity framework, you need to perform some setup steps:
-
Open your app’s
Info.plist
file. -
Add the following entry to enable gifting functionality:
-
Key:
NSExtension
-
Type:
Dictionary
-
Add the following sub-entry under
NSExtension
:-
Key:
NSExtensionActivities
-
Type:
Array
-
Add a new item to the
NSExtensionActivities
array with the following properties:-
Key:
NSExtensionActivityIdentifier
-
Type:
String
-
Value:
com.example.myapp.gift
(replace with your app’s identifier)
-
Key:
-
Key:
-
Key:
-
Save the changes to your
Info.plist
file.
Usage
Using the MDMGiftAppActivity framework is straightforward:
-
Import the framework in your View Controller:
import MDMGiftAppActivity
-
Create an instance of the
MDMGiftAppActivity
class:let giftActivity = MDMGiftAppActivity()
-
Set any desired properties of the
MDMGiftAppActivity
instance, such as the share message:giftActivity.shareMessage = "Check out this amazing app!"
-
Add the
MDMGiftAppActivity
instance to theUIActivityViewController
:let activityViewController = UIActivityViewController(activityItems: [giftActivity], applicationActivities: nil)
-
Present the
UIActivityViewController
:present(activityViewController, animated: true, completion: nil)
Advanced Features
The MDMGiftAppActivity framework provides various advanced features:
-
Customization: You can customize the appearance and behavior of the gifting UI by modifying the
MDMGiftAppActivity
instance’s properties. - Delegate: The framework allows you to implement a delegate to receive callbacks and handle specific events.
Troubleshooting
If you encounter any issues while using the MDMGiftAppActivity framework, try the following troubleshooting steps:
- Ensure you have completed the installation and setup steps correctly.
- Check if there are any conflicts with other frameworks or libraries in your project.
- Review the framework’s documentation and examples provided by the developer.
- Reach out to the developer or community for assistance.