{"id":25651334,"url":"https://github.com/devengagelab/push-sdk-swift","last_synced_at":"2026-06-18T17:32:58.550Z","repository":{"id":138721401,"uuid":"566687271","full_name":"DevEngageLab/push-sdk-swift","owner":"DevEngageLab","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-07T08:07:54.000Z","size":141,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-23T16:54:59.257Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevEngageLab.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,"publiccode":null,"codemeta":null}},"created_at":"2022-11-16T07:50:12.000Z","updated_at":"2024-08-07T08:07:58.000Z","dependencies_parsed_at":"2024-08-07T11:42:56.430Z","dependency_job_id":"b019554b-0db8-4609-9a0f-04969b4ea2b9","html_url":"https://github.com/DevEngageLab/push-sdk-swift","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DevEngageLab/push-sdk-swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevEngageLab%2Fpush-sdk-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevEngageLab%2Fpush-sdk-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevEngageLab%2Fpush-sdk-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevEngageLab%2Fpush-sdk-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevEngageLab","download_url":"https://codeload.github.com/DevEngageLab/push-sdk-swift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevEngageLab%2Fpush-sdk-swift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34501474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-02-23T16:55:01.217Z","updated_at":"2026-06-18T17:32:58.533Z","avatar_url":"https://github.com/DevEngageLab.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MTPush Swift Demo\n\nOffically supported Swift Demo for EngageLab MTPush iOS SDK. \n\n## MTPush SDK SetUp\n\n#### Manual\n\n* Select \"Add files to 'Your project name'...\" in Xcode and add the decompressed lib subfolder (containing mtpush-ios-x.x.x.xcframework) to your project directory.\n\n* add Framework \n  ○ CFNetwork.framework\n  ○ CoreFoundation.framework\n  ○ CoreTelephony.framework\n  ○ SystemConfiguration.framework\n  ○ CoreGraphics.framework\n  ○ Foundation.framework\n  ○ UIKit.framework\n  ○ Security.framework\n  ○ libz.tbd\n  ○ UserNotifications.framework\n  ○ libresolv.tbd\n  ○ libsqlite3.tbd\n  \n\n##### Build Settings\n\n* Set the `User Header Search Paths` and `Library Search Paths` under `Search Paths`. For example, if the SDK folder (default is lib) and the project file are in the same directory, set them to \"$(SRCROOT)/{name of the folder where the static library is located} \".\n\n##### Capabilities\n\nIf you are developing using Xcode 8 or above environment, please turn on the `Capabilities-\u003ePush Notifications ` option of Application Target.\n\nIf you are developing using Xcode 10 or above environment, please turn on the `Capabilities-\u003eAccess WIFI Infomation` option of Application Target.\n\n\n#### Cocoapods 导入\n\n```\npod 'MTPush'\n```\n\n* If you need to install a specific version, use the following method (taking MTPush 4.4.0 version as an example):\n\n```\npod 'MTPush', '4.4.0'\n```\n\n\n#### Create a new Objective-C `Bridging Header file` in the project\n\n\n#### Import the mtpush header file into the newly generated Objective-C `Bridging Header file`\n\n```\n#import \"MTPushService.h\"\n```\n\n#### Add the following code in the didFinishLaunching method of the Appdelegate.swift file\n\n\n```\n  func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -\u003e Bool {\n    \n     let entity = MTPushRegisterEntity()\n        if #available(iOS 12.0, *) {\n            \n            let types = MTPushAuthorizationOptions(rawValue: (MTPushAuthorizationOptions.alert.rawValue |\n                                                              MTPushAuthorizationOptions.sound.rawValue |\n                                                              MTPushAuthorizationOptions.badge.rawValue |\n                                                              MTPushAuthorizationOptions.providesAppNotificationSettings.rawValue))\n            \n            entity.types = Int(types.rawValue)\n\n        } else {\n            let types = MTPushAuthorizationOptions(rawValue: (MTPushAuthorizationOptions.alert.rawValue |\n                                                              MTPushAuthorizationOptions.sound.rawValue |\n                                                              MTPushAuthorizationOptions.badge.rawValue\n                                                              ))\n            entity.types = Int(types.rawValue)\n        }\n        \n        if #available(iOS 10.0, *) {\n         \n        } else {\n        }\n    \n        MTPushService.register(forRemoteNotificationConfig: entity, delegate: self)\n        \n        // init\n        MTPushService.setup(withOption: launchOptions, appKey: appKey, channel: channel, apsForProduction: isProduction)\n    \n    return true\n  }\n```\n\n#### Add the following code in the didRegisterForRemoteNotificationsWithDeviceToken method of the Appdelegate.swift file\n\n\n```\n  func application(application: UIApplication,\n    didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {\n      print(\"get the deviceToken  \\(deviceToken)\")\n    MTPushService.registerDeviceToken(deviceToken)\n      \n  }\n```\n\n#### Added callback method for handling APNs notifications\n\nImplement the callback method in Appdelegate.swift and add the code in the callback method\n\n```\nfunc mtpNotificationCenter(_ center: UNUserNotificationCenter!, willPresent notification: UNNotification!, withCompletionHandler completionHandler: ((Int) -\u003e Void)!) {\n                \n        if ((notification.request.trigger?.isKind(of: UNPushNotificationTrigger.self)) != nil) {\n            MTPushService.handleRemoteNotification(userInfo)\n                    }\n        completionHandler(NSInteger(UNNotificationPresentationOptions.alert.rawValue) |\n                          NSInteger(UNNotificationPresentationOptions.sound.rawValue) |\n                          NSInteger(UNNotificationPresentationOptions.badge.rawValue) )\n    }\n    \n    @available(iOS 10.0, *)\n    func mtpNotificationCenter(_ center: UNUserNotificationCenter!, didReceive response: UNNotificationResponse!, withCompletionHandler completionHandler: (() -\u003e Void)!) {\n                \n        if ((response.notification.request.trigger?.isKind(of: UNPushNotificationTrigger.self)) != nil) {\n            MTPushService.handleRemoteNotification(userInfo)\n        }\n        completionHandler()\n    }\n    \n    @available(iOS 10.0, *)\n    func mtpNotificationCenter(_ center: UNUserNotificationCenter!, openSettingsFor notification: UNNotification!) {\n    }\n    \n    func mtpNotificationAuthorization(_ status: MTPushAuthorizationStatus, withInfo info: [AnyHashable : Any]!) {\n        print(\"receive notification authorization status:\\(status), info:\\(String(describing: info))\")\n       alertNotificationAuthorization(status)\n    }\n    \n     func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {\n        MTPushService.handleRemoteNotification(userInfo)\n        print(\"iOS6 and below systems, notification received:\\(userInfo)\")\n    }\n    \n    \n    func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -\u003e Void) {\n        MTPushService.handleRemoteNotification(userInfo)\n        print(\"iOS7 and above systems, notification received:\\(userInfo)\")\n        completionHandler(.newData)\n    }\n    \n```\n\n#### Run successfully\n\nDebug the project on a real machine. If the console outputs the following log, it means that you have successfully integrated.\n\n```\n2021-08-19 17:12:12.745823 219b28[1443:286814] | MTP | I - [MTCORETcpEventController] \n----- login result -----\nuid:123456 \nregistrationID:171976fa8a8620a14a4 \nidc:0\n```\n\nAt this point, the basic functions of integrating MTPush sdk have been completed. If you need more functions, please refer to the Demo project.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevengagelab%2Fpush-sdk-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevengagelab%2Fpush-sdk-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevengagelab%2Fpush-sdk-swift/lists"}