core telephony notifications in 3.0

Discussion in 'iOS Development' started by Jeepston, Jun 25, 2009.

  1. Jeepston

    Jeepston New Member

    Joined:
    May 17, 2009
    Messages:
    45
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    Recently I've got my hands on JB 3G with 3.0. I need to port one of my dylibs which was perfectly working on 2.2.1 and lower. This dylib was detecting incoming SMS. But on 3.0 it doesn't work. To figure out why, I have started notificationWatcher (from Erica Utilities). And for some reason there was no kCTSMSMessageReceivedNotification event when incoming SMS arrived. Instead, I've got some strange kCTMessageReceivedNotification. Furthermore, my callback function did not receive parameter "object" which contains message itself.

    Now I am shooting in the dark trying to make this dylib to work with OS 3.0 but so far without any essential success. So, may be someone got the same problem and already knows how to correctly set up observer to listen to incoming SMS in new firmware?

    For comparison, this is output of notificationWatcher in 3.0:

    Code:
    Notification intercepted: kCTMessageReceivedNotification
    <CFDictionary 0x10a040 [0x382084f8]>{type = immutable, count = 2, capacity = 3, pairs = (
            1 : <CFString 0x3a70d62c [0x382084f8]>{contents = "kCTMessageTypeKey"} = <CFNumber 0x10a2d0 [0x382084f8]>{value = +1, type = kCFNumberSInt32Type}
            3 : <CFString 0x3a70d5dc [0x382084f8]>{contents = "kCTMessageIdKey"} = <CFNumber 0x100ad0 [0x382084f8]>{value = -2147483647, type = kCFNumberSInt32Type}
    And this is how it looks in 2.2:
    Code:
    Notification intercepted: kCTSMSMessageReceivedNotification
    <CFDictionary 0x30ad40 [0x382372fc]>{type = immutable, count = 1, capacity = 3, pairs = (
            2 : <CFString 0x39bd65d0 [0x382372fc]>{contents = "kCTSMSMessage"} = <CTSMSMessage 0x30a400 [0x382372fc]>{}
    
    Any help or hints in what direction to go, will be greatly appreciated.
  2. Cyanidepoison

    Cyanidepoison Active Member

    Joined:
    Jan 18, 2008
    Messages:
    1,076
    Likes Received:
    2
    3.0 is built for MMS. Calling the notification CTSMSMessageRecieved wouldn't be right, because that notification would be sent for an audio or picture message.

    I'm guessing that the 3.0 notification contains an ID to retrieve the message from the Messages database.
  3. amitchauhan

    amitchauhan New Member

    Joined:
    Jun 23, 2009
    Messages:
    24
    Likes Received:
    0
    Device:
    iPhone 3G (Black)
    Hello,

    I am also using Core Telephony framework, I have defined the Privae framework header file path in OTHER C Flag underneath GCC 4.0.

    I am able to run the Application on Device but I am having trouble to debug the Application using Device.

    Could you please advise me how can i fix that?

    Thanks in Advance.
    Amit Kushvaha
  4. Jeepston

    Jeepston New Member

    Joined:
    May 17, 2009
    Messages:
    45
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    Are you able to intercept notifications about incoming messages and info related to those messages?
  5. amitchauhan

    amitchauhan New Member

    Joined:
    Jun 23, 2009
    Messages:
    24
    Likes Received:
    0
    Device:
    iPhone 3G (Black)
    I am able to intercept the Calls notification.But unable to debug,

    Could you please advise me how to debug the Application using device?

    Your advise would be greatly appriciated.

    Thanks in Advance.
    Amit Kushvaha
  6. Jeepston

    Jeepston New Member

    Joined:
    May 17, 2009
    Messages:
    45
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    Is your application a dylib?
  7. amitchauhan

    amitchauhan New Member

    Joined:
    Jun 23, 2009
    Messages:
    24
    Likes Received:
    0
    Device:
    iPhone 3G (Black)
    Hello,

    I ma using siple Open tool chain xcode template with NO signing certificate required.
    I am using self signed certificate and havinf MobileInstallation patch in my iphone.
    Application is running successfully on device if i connect my iPhone with My Mac machine via USB.But i have some breakpoints. but debugger is not breaking on breakpoints.
    Please advise me How to debug my Application.

    My Start up source code is below.


    Amit Chauhan:
    - (void)applicationDidFinishLaunchingNSNotification *)notification {
    // Create window
    window = [[UIWindow alloc] initWithContentRect: [UIHardware fullScreenApplicationContentRect]];

    // Set up content view
    CGRect rect=[UIHardware fullScreenApplicationContentRect];
    rect.origin.x=rect.origin.y=0.0f;

    mainView = [[MainView alloc] initWithFrame: rect];
    //[mainView setBackgroundColor:[UIColor redColor]];
    [window setContentView: mainView];
    [window makeKey:self];
    // Show window
    [window orderFront:self];
    [window makeKeyAndVisible];
    [window _setHidden:NO];
    }
    - (void)dealloc {
    //[mainView release];
    [window release];
    [super dealloc];
    }
    @end
  8. Jeepston

    Jeepston New Member

    Joined:
    May 17, 2009
    Messages:
    45
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    That's strange. I can use xcode debugger on JB 2.2 device. I am also creating applications with Open Toolchain templates.
  9. amitchauhan

    amitchauhan New Member

    Joined:
    Jun 23, 2009
    Messages:
    24
    Likes Received:
    0
    Device:
    iPhone 3G (Black)
    Thanks for your reply!

    Could you please let me know, How to use that to debug the open tool chain App.
    I have jailbreaked & unlocked device with iphone OS 2.2.1?

    Thanks again!
  10. Jeepston

    Jeepston New Member

    Joined:
    May 17, 2009
    Messages:
    45
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    Make sure that you compile for "Device - 2.2.1 | Debug". After compilation try Run -> Debug.

Share This Page