跳转至

【Apple group sending iMessage push location push】

【iMessage Apple push group sending】Apple Photo Album pushes archive to appstore development certificate (Development certificate)

public static String getMacAddress(

/One thing to note when getting the mac address is that after the Android 6.0 version, the following explanation method is no longer applicable. Any mobile phone will return the default mac address "02:00:00:00:00:00". This It is Google officials who disabled the getSYstemService(Context.WIFI_SERVICE) method to obtain the mac address in order to enhance permission management. /

// String macAddress= "";

// WifiManager wifiManager = (WifiManager) MyApp.getContext().getSystemService(Context.WIFI_SERVICE);

// WifiInfo wifiInfo = wifiManager.getConnectionInfo();

// macAddress = wifiInfo.getMacAddress();

// return macAddress;

iMessage is a newly launched APPEXtension in iOS10. It can add our own content to system application messages, send them to friends, and even operate with your friends in the same message. This article mainly discusses how to quickly integrate emoticons in iMessage. APPEXTENSION and host APP have their own independent spaces, so IMessageExtension can also exist alone, or it can be packaged with the host APP and uploaded to the same project, and users can download iMessageApp (Download) or host App in iMessagestore) Or after the host App (in the AppStore) is downloaded, another one will be automatically downloaded. 1. Templates utilizing X code IMESSAGEEXTENSITION IMESSAGESDK have been integrated in iOS10, so the required X code version must be X-Code8+. Select File->New->Project->Application->StickerPackApplication as shown: When finished, the project layout is very simple and has no classes, so we don't need to write any code. All we need to do is put a photo. As shown in the figure: In the stickers.xcstickers file, add iMessageAppicon according to the image size, which is the icon displayed in iMessageStore. Then add the emoji image to the STICKERPACK. It should be noted that officials have previously proposed changes to emoji sizes. Details below:

, rge.206x206points@3x (618x618 pixels). Additionally, if only @3x is provided, the system will automatically generate @2x and @1x. 2. Custom tags If the template provided by X code cannot meet our needs, you can use a custom mode. Compared to the X code template, select "File" -> "New" -> "Project" -> "Application" -> "iMessageApplication". Projects built using this method also have a folder called MessgaeExtension. But there is no StickerPack folder in Assets.xcassets. So if you use custom tags, you don't need to add emoticons in Assets.xcassets. You can put resource files into our project. Just one MessageViewControlle is not enough. Custom stickers require MSStickerBrowserViewController, and our resource files are also loaded through this class. You can think of MessageViewControlle as a ViewControlle and MSStickerBrowserViewController as a UITableViewController. Therefore, we need to create a view controller that inherits from MSStickerBrowserViewController and if its name is: MyStickerBrowserViewController#import @

interfaceMyStickBrowserViewController: MSStickerBrowserViewController // Handy protocol @property (non-atomic, strong) NSMutableArray * dateArray; // Data source data @ end12345678 Check this protocol: - (NSInteger) numberOfStickersInStickerBrowserView: (MSStickerBrowserView ) stickerBrowserView; - (MSSticker ) stickerBrowserView: (MSStickerBrowserView ) stickerBrowserViewstickerAtIndex: (NSIntegerSource) index; 1234 is similar in principle. Below we just need to load the local expression resource: - (void) loadView {[superloadView]; self.dateArray = [NSMutableArrayarray]; self.stickerBrowserView.dataSource = self; for (inti = 1; i<TOTAL_STICKER; i++) {NSString nameStr = [NSStringstringWithFormat:@"bh_%d",i]; NSURL url = [[NSBundlemainBundle] URLForResource:nameStrwithExtension:@"png"]; MSSticker sticker = [[MSStickeralloc] initWithContentsOfFileURL:urllocalizedDescription:@" "Problem

:None]; [self.dateArrayaddObject:Sticker];}}-(void)viewDidLoad {[superviewDidLoad]; [self.stickerBrowserViewreloadData]; //Data source has been loaded, innovative interface [This is just a demonstration, the actual loading process is in progress data, you can start sub-threads for disposal as needed]) 123456789101112131415415171171819 Complete Protocol - (NSInteger) numberOfStickersInStickerBrowserView: (MSStickerBrowserView ) StickerBrowserView {returnself.dateArray.count;} - (MSSticker )

stic

kerBrowserstickerView: (MSSticker ) stickerBrowserstickerView: (MSSticker )) stickerAttickerIndex index {MSSticker * sticker = self.da teArray [index]; 123456789 The last part, we just put the created MyStickerBrowserViewController into the MessageViewController. self.stickBrowserViewController = [[[MyStickBrowserViewControlleralloc] initWithStickerSize:MSStickerSizeSmall]; [selfaddChildViewController:self.stickBrowserViewController]; [self.viewaddSubview:self.stickBrowserViewController.view]; 12345, you can see the emoji we created in the message. In addition: If you want to integrate iMessage into an existing project, please select File->New->Target->iMessageExtension **, as shown in the figure: other operations are the same as above.

    String macAddress = null;

     StringBuffer buf = new StringBuffer();

     NetworkInterface networkInterface = null;

     try {

         networkInterface = NetworkInterface.getByName("eth1");

         if (networkInterface == null) {

             networkInterface = NetworkInterface.getByName("wlan0");

         }

         if (networkInterface == null) {

             return "02:00:00:00:00:02";

         }

         byte[] addr = networkInterface.getHardwareAddress();

         for (byte b : addr) {

             buf.append(String.format("%02X:", b));

         }

         if (buf.length() > 0) {

             buf.deleteCharAt(buf.length() - 1);

         }

         macAddress = buf.toString();

     } catch (SocketException e) {

         e.printStackTrace();

         return "02:00:00:00:00:02";

     }

     return macAddress;

 }