I want to send a notification from my iPhone to another iPhone

Before starting, I understand that this problem was raised earlier in this forum because I found a thread. However, the question did not answer.

I am creating a system using the iPhone as a working machine. I say this because I want to focus on the phone, which is not an apple product, but as part of the equipment that is either capable or does not fulfill the task.

I have jailbroken both phones that I use and will use them solely to solve the problem that the system decided to solve. My system will be used by me and me alone, and therefore the question of how Apple should use these devices, the user interface, etc., is not relevant to me.

Well, having said everything, I will briefly describe the system. Two iPhones, one with its guts in an electronic project box nailed over my front door, with a camera facing visitors. Another iPhone intact and in my pocket. I connected contacts 1 and 11 to the doorbell button and warned the phone about pressing it, controlling the change in the audio route. I need an application on my mobile phone that will be woken up by a notification sent by the door phone. The door phone will also send an image as soon as I have received a notification on my mobile phone. There is no internet here, I have a Wi-Fi router that both phones are connected to.

So, so that the system, I searched high and low to find a code that can help me get a phone call to create a push notification and send it to my mobile phone, all I have found so far is https: // github .com / stefanhafeneger / PushMeBaby , which I only need for Mac, not iPhone, and I'm new to Objective-C, so porting is really hard.

, - , , , , Apple , , , . -, , , , , , , , /, , . , .

+5
2

Bluetooth GameKit.

SO , Bluetooth iPhone: bluetooth iPhone?

- GameKit. Apple, : http://developer.apple.com/library/ios/#samplecode/GKTank/Introduction/Intro.html

, ( TankViewController.m):

- (void)sendNetworkPacket:(GKSession *)session packetID:(int)packetID withData:(void *)data ofLength:(int)length reliable:(BOOL)howtosend {
    // the packet we'll send is resued
    static unsigned char networkPacket[kMaxTankPacketSize];
    const unsigned int packetHeaderSize = 2 * sizeof(int); // we have two "ints" for our header

    if(length < (kMaxTankPacketSize - packetHeaderSize)) { // our networkPacket buffer size minus the size of the header info
        int *pIntData = (int *)&networkPacket[0];
        // header info
        pIntData[0] = gamePacketNumber++;
        pIntData[1] = packetID;
        // copy data in after the header
        memcpy( &networkPacket[packetHeaderSize], data, length ); 

        NSData *packet = [NSData dataWithBytes: networkPacket length: (length+8)];
        if(howtosend == YES) { 
            [session sendData:packet toPeers:[NSArray arrayWithObject:gamePeerId] withDataMode:GKSendDataReliable error:nil];
        } else {
            [session sendData:packet toPeers:[NSArray arrayWithObject:gamePeerId] withDataMode:GKSendDataUnreliable error:nil];
        }
    }
}
0

. ( , ...). , :

- . , , Apache - . , , - . , / push push Apple, , , , - .: (

0

All Articles