{"id":19337310,"url":"https://github.com/infobip/mobile-messaging-sdk-ios","last_synced_at":"2026-02-03T10:12:06.903Z","repository":{"id":39261782,"uuid":"56227703","full_name":"infobip/mobile-messaging-sdk-ios","owner":"infobip","description":"Mobile Messaging SDK for iOS","archived":false,"fork":false,"pushed_at":"2025-04-14T09:23:42.000Z","size":14343,"stargazers_count":60,"open_issues_count":1,"forks_count":21,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-14T09:53:30.448Z","etag":null,"topics":["apns","ios","notifications","push","push-notifications","pushnotifications"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/infobip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-04-14T10:14:32.000Z","updated_at":"2025-04-14T09:23:46.000Z","dependencies_parsed_at":"2023-02-16T07:30:31.375Z","dependency_job_id":"c68cbf2d-df23-4676-bd9f-16f9aefd3ce4","html_url":"https://github.com/infobip/mobile-messaging-sdk-ios","commit_stats":{"total_commits":1289,"total_committers":22,"mean_commits":58.59090909090909,"dds":0.6051202482544609,"last_synced_commit":"7c18b04dc30174cb28f65337276696fc83961cdd"},"previous_names":[],"tags_count":336,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infobip%2Fmobile-messaging-sdk-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infobip%2Fmobile-messaging-sdk-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infobip%2Fmobile-messaging-sdk-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infobip%2Fmobile-messaging-sdk-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infobip","download_url":"https://codeload.github.com/infobip/mobile-messaging-sdk-ios/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250352206,"owners_count":21416454,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apns","ios","notifications","push","push-notifications","pushnotifications"],"created_at":"2024-11-10T03:14:01.359Z","updated_at":"2026-02-03T10:12:06.897Z","avatar_url":"https://github.com/infobip.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mobile Messaging SDK for iOS\n\n[![Version](https://img.shields.io/cocoapods/v/MobileMessaging.svg?style=flat)](http://cocoapods.org/pods/MobileMessaging)\n[![License](https://img.shields.io/cocoapods/l/MobileMessaging.svg?style=flat)](http://cocoapods.org/pods/MobileMessaging)\n[![Platform](https://img.shields.io/cocoapods/p/MobileMessaging.svg?style=flat)](http://cocoapods.org/pods/MobileMessaging)\n\nMobile Messaging SDK is designed and developed to easily enable push notification channel in your mobile application. In almost no time of implementation you get push notification in your application and access to the features of \u003ca href=\"https://www.infobip.com/en/products/mobile-app-messaging\" target=\"_blank\"\u003eInfobip Mobile Apps Messaging\u003c/a\u003e. The document describes library integration steps. Additional information can be found in our \u003ca href=\"https://github.com/infobip/mobile-messaging-sdk-ios/wiki\" target=\"_blank\"\u003eWiki\u003c/a\u003e.\n\n## Requirements\n- Xcode 16+\n- Swift 5.5+\n- iOS 15.0+\n\n## Quick start guide\nThis guide is designed to get you up and running with Mobile Messaging SDK integrated into your iOS application. \n\n1. Make sure to \u003ca href=\"https://www.infobip.com/docs/mobile-app-messaging/getting-started#create-and-enable-a-mobile-application-profile\" target=\"_blank\"\u003esetup application at Infobip portal\u003c/a\u003e, if you haven't already.\n\n2. Configure your project to support Push Notifications:\n    1. Click on \"Capabilities\", then turn on Push Notifications. Entitlements file should be automatically created by Xcode with set `aps-environment` value.\n    \u003cimg src=\"https://github.com/infobip/mobile-messaging-sdk-ios/wiki/Images/push_capabilities.png?raw=true\" alt=\"Enable Push Notifications capability\"/\u003e\n    \n    2. Turn on Background Modes and check the Remote notifications checkbox.\n    \u003cimg src=\"https://github.com/infobip/mobile-messaging-sdk-ios/wiki/Images/background_modes.png?raw=true\" alt=\"Enable Remote Notifications in Background Modes settings\"/\u003e\n    \n3. Include Mobile Messaging as dependency in your project with your preferred method:\n\na) Using \u003ca href=\"https://github.com/infobip/mobile-messaging-sdk-ios/wiki/Integration-via-Swift-Package-Manager\" target=\"_blank\"\u003eSwift Package Manager\u003c/a\u003e, directly in Xcode's *Package Dependencies* or your *Package.swift* file, from this URL: https://github.com/infobip/mobile-messaging-sdk-ios.\n\nb) Or alternatively, using \u003ca href=\"https://guides.cocoapods.org/using/getting-started.html#getting-started\" target=\"_blank\"\u003eCocoaPods\u003c/a\u003e, specify it in your `Podfile`:\n\n    ```ruby\n    source 'https://github.com/CocoaPods/Specs.git'\n    platform :ios, '12.0'\n    use_frameworks!\n    pod 'MobileMessaging'\n    ```\n\n    \u003e #### Notice \n    \u003e CocoaLumberjack logging used by default, in order to use other logging or switch it off follow [this guide](https://github.com/infobip/mobile-messaging-sdk-ios/wiki/How-to-install-the-SDK-without-CocoaLumberjack%3F).\n\n    If you use Carthage, see \u003ca href=\"https://github.com/infobip/mobile-messaging-sdk-ios/wiki/Integration-via-Carthage\" target=\"_blank\"\u003eIntegration via Carthage\u003c/a\u003e guide.\n\n4. Import the library into your AppDelegate file:\n\n    ```swift\n    // Swift\n    import MobileMessaging\n    ```\n    \u003cdetails\u003e\u003csummary\u003eexpand to see Objective-C code\u003c/summary\u003e\n    \u003cp\u003e\n\n    ```objective-c\n    @import MobileMessaging;\n    ```\n\n    \u003c/p\u003e\n    \u003c/details\u003e\n\n5. Start MobileMessaging service using your Infobip Application Code, obtained in step 1, and preferable notification type as parameters:\n\n    ```swift\n    // Swift\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -\u003e Bool {\n        MobileMessaging.withApplicationCode(\u003c#your application code#\u003e, notificationType: \u003c#for example MMUserNotificationType(options: [.alert, .sound])#\u003e)?.start()\n        ...\n    }   \n    ```\n\n    \u003cdetails\u003e\u003csummary\u003eexpand to see Objective-C code\u003c/summary\u003e\n    \u003cp\u003e\n\n    ```objective-c\n    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n        MMUserNotificationType *userNotificationType = [[MMUserNotificationType alloc] initWithOptions:\u003c#for example @[MMUserNotificationType.alert, MMUserNotificationType.sound]#\u003e;\n        [[MobileMessaging withApplicationCode: \u003c#your application code#\u003e notificationType: userNotificationType] start:nil];\n        ...\n    }\n    ```\n\n    \u003c/p\u003e\n    \u003c/details\u003e\n\n    In case you already use other Push Notifications vendor's SDK, add `withoutRegisteringForRemoteNotifications()` to the start call:\n    \n    ```swift\n    // Swift\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -\u003e Bool {\n        MobileMessaging.withApplicationCode(\u003c#your application code#\u003e, notificationType: \u003c#for example MMUserNotificationType(options: [.alert, .sound])#\u003e)?.withoutRegisteringForRemoteNotifications()?.start()\n        ...\n    }   \n    ```\n\n    Please note that it is not very secure to keep your API key (Application Code is an API key in fact) hardcoded so if the security is a crucial aspect, consider obfuscating the Application Code string (we can recommend \u003ca href=\"https://github.com/UrbanApps/UAObfuscatedString\" target=\"_blank\"\u003eUAObfuscatedString\u003c/a\u003e for string obfuscation).\n\n6. Add one line of code `MobileMessaging.didRegisterForRemoteNotificationsWithDeviceToken(deviceToken)` to your AppDelegate method `application:didRegisterForRemoteNotificationsWithDeviceToken:` in order to inform Infobip about the new device registered:\n\n    ```swift\n    // Swift\n    func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {\n        MobileMessaging.didRegisterForRemoteNotificationsWithDeviceToken(deviceToken)\n        \n        // other push vendors might have their code here and handle a Device Token as well\n    }\n    ```\n\n    \u003cdetails\u003e\u003csummary\u003eexpand to see Objective-C code\u003c/summary\u003e\n    \u003cp\u003e\n\n    ```objective-c\n    - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {\n        [MobileMessaging didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];\n\n        // other push vendors might have their code here and handle a Device Token as well\n    }\n    ```\n\n    \u003c/p\u003e\n    \u003c/details\u003e\n\n7. Add one line of code `MobileMessaging.didReceiveRemoteNotification(userInfo, fetchCompletionHandler: completionHandler)` to your AppDelegate method `application:didReceiveRemoteNotification:fetchCompletionHandler:` in order to send notification's delivery reports to Infobip:\n\n    ```swift\n    // Swift\n    func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -\u003e Void) {\n        MobileMessaging.didReceiveRemoteNotification(userInfo, fetchCompletionHandler: completionHandler)\n\n        // other push vendors might have their code here and handle a remove notification as well\n    }\n    ```\n\n    \u003cdetails\u003e\u003csummary\u003eexpand to see Objective-C code\u003c/summary\u003e\n    \u003cp\u003e\n\n    ```objective-c\n    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {\n        [MobileMessaging didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];\n\n        // other push vendors might have their code here and handle a remove notification as well\n    }\n    ```\n\n    \u003c/p\u003e\n    \u003c/details\u003e\n\n8. [Integrate Notification Service Extension](https://github.com/infobip/mobile-messaging-sdk-ios/wiki/Notification-Service-Extension-for-Rich-Notifications-and-better-delivery-reporting-on-iOS) into your app in order to obtain:\n    - more accurate processing of messages and delivery stats\n    - support of rich notifications on the lock screen\n\n\u003cbr\u003e\nIn case of a clean project, your AppDelegate.swift code should look like following:\n\u003cimg src=\"https://github.com/infobip/mobile-messaging-sdk-ios/wiki/Images/app_delegate.png?raw=true\" alt=\"AppDelegate source code example\"/\u003e\n\nIf all the steps implemented correctly, run your application on a real device, you should see the logs in Xcode console confirming that the MobileMessaging SDK has been initialized successfully and the device has been registered on APNS to receive Push messages:\n```\n2023-01-28 18:24:16:003 [MobileMessaging] ℹ️ SDK successfully initialized!\n...\n2023-01-28 18:25:44:144 [MobileMessaging] ℹ️ [APNS reg manager] Application did register with device token \u003c...\u003e\n```\nIf you don't see any logs, set up the default logger before starting the SDK: `MobileMessaging.logger = MMDefaultLogger()`. Please note that the logs are only collected while your project is in \"debug\" configuration.\n\n**Please pay close attention to a Provisioning Profile that is used for your project build. It must match the APNs environment! If they don't, we'll invalidate the device push registration (more information here [I don't receive push notifications!](https://github.com/infobip/mobile-messaging-sdk-ios/wiki/I-don't-receive-push-notifications)**\n\n\u003e #### Notice\n\u003e Push notifications (if they are not [in-app](https://github.com/infobip/mobile-messaging-sdk-ios/wiki/In-app-notifications)) are not displayed automatically when the app is on the foreground. For further information check [FAQ - How to display messages when app is running in the foreground?](https://github.com/infobip/mobile-messaging-sdk-ios/wiki/How-to-display-messages-when-app-is-running-in-the-foreground%3F).\n\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\u003cb\u003eNEXT STEPS: \u003ca href=\"https://github.com/infobip/mobile-messaging-sdk-ios/wiki/Users-and-installations\"\u003eUsers and installations\u003c/a\u003e\u003c/b\u003e\u003c/p\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n| If you have any questions or suggestions, feel free to send an email to support@infobip.com or create an \u003ca href=\"https://github.com/infobip/mobile-messaging-sdk-ios/issues\" target=\"_blank\"\u003eissue\u003c/a\u003e. |\n|---|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfobip%2Fmobile-messaging-sdk-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfobip%2Fmobile-messaging-sdk-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfobip%2Fmobile-messaging-sdk-ios/lists"}