iOS SDK

Last updated:2024-05-08

MT iOS SDK v4.3.4

Update Date

  • May 08, 2024

Changelog

  • Added support for voice broadcast of push content, applicable to various push scenarios such as "Payment Broadcast" and "Bus Arrival Broadcast."

Update Guide

Prerequisites for using the voice broadcast feature: The application needs to enable the appgroups feature and activate App Groups in Xcode. Both the extension program and the main project need to activate this feature and fill in the value of App Groups.

Before initializing MTPush, execute the following code:

// Set App Group ID (please replace with your actual App Group ID). [MTPushService setAppGroupId:@"group.jiguang.hxhg"]; // Enable the text-to-speech feature for push notifications. [MTPushService enablePushTextToSpeech:YES]; // In your notification extension: // Set App Group ID in the notification extension. [MTNotificationExtensionService mtpushSetAppGroupId:@"group.jiguang.hxhg"]; // Set site name, for example "Singapore". [MTNotificationExtensionService setSiteName:@"Singapore"]; // Set Appkey (please replace with your actual Appkey). [MTNotificationExtensionService mtpushSetAppkey:@"dab1134204a962d4ca905cce"]; // Log the start of processing the voice file. NSLog(@"start - Begin processing voice file"); // Process the voice. [MTNotificationExtensionService handleVoice:request with:^(NSString *soundName) { // Assign a custom sound to the notification. self.bestAttemptContent.sound = [UNNotificationSound soundNamed:soundName]; // Log the end of processing the voice file. NSLog(@"stop - End processing voice file"); // Process the notification request. [MTNotificationExtensionService mtpushReceiveNotificationRequest:request with:^ { // Log the successful upload to APNS. NSLog(@"apns upload success"); // Complete the modification of the notification content. self.contentHandler(self.bestAttemptContent); }]; }];
            // Set App Group ID (please replace with your actual App Group ID).
  [MTPushService setAppGroupId:@"group.jiguang.hxhg"];

  // Enable the text-to-speech feature for push notifications.
  [MTPushService enablePushTextToSpeech:YES];

  // In your notification extension:

  // Set App Group ID in the notification extension.
  [MTNotificationExtensionService mtpushSetAppGroupId:@"group.jiguang.hxhg"];

  // Set site name, for example "Singapore".
  [MTNotificationExtensionService setSiteName:@"Singapore"];

  // Set Appkey (please replace with your actual Appkey).
  [MTNotificationExtensionService mtpushSetAppkey:@"dab1134204a962d4ca905cce"];

  // Log the start of processing the voice file.
  NSLog(@"start - Begin processing voice file");

  // Process the voice.
  [MTNotificationExtensionService handleVoice:request with:^(NSString *soundName) {

    // Assign a custom sound to the notification.
    self.bestAttemptContent.sound = [UNNotificationSound soundNamed:soundName];

    // Log the end of processing the voice file.
    NSLog(@"stop - End processing voice file");

    // Process the notification request.
    [MTNotificationExtensionService mtpushReceiveNotificationRequest:request with:^ {

      // Log the successful upload to APNS.
      NSLog(@"apns upload success");

      // Complete the modification of the notification content.
      self.contentHandler(self.bestAttemptContent);

    }];
  }];

        
This code block in the floating window

MT iOS SDK v4.3.3

Update time

  • 2024-03-08

Change Log

  • New support for data nodes in Frankfurt, Germany.
  • Add privacy list to adapt to the latest Apple policies.

MT iOS SDK v4.3.2

Update time

  • 2023-11-06

Change Log

  • Fixed known bugs.

MT iOS SDK v4.3.1

Update time

  • 2023-09-23

Change Log

  • Solve the problem of compiling errors in xcode15 using cocoapods integration.
  • Fixed known bugs.

MT iOS SDK v4.3.0

update time

  • 2023-08-23

change log

  • Support configuration data center function.
  • Support API function for setting user language (setUserLanguage).
  • Fix known bugs.

MT iOS SDK v3.5.0

update time

  • 2023-05-15

change log

  • Support tag/alias push.

MT iOS SDK v3.3.0

Release Date

  • 2023-04-04

Change Log

  • Added tcp encryption interface, please call [MTPushService setTcpSSL:YES] before initializing the interface.
在文档中心打开