Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
13 replies Latest Post - ‏2013-01-17T19:52:07Z by SystemAdmin
brock_smith
brock_smith
42 Posts
ACCEPTED ANSWER

Pinned topic IOS push notification

‏2013-01-07T13:56:28Z |
Hi Adan,
Would u please suggest steps for Iphone Push Notification as u did for Android "https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14905176"
  • brock_smith
    brock_smith
    42 Posts
    ACCEPTED ANSWER

    Re: IOS push notification

    ‏2013-01-07T14:05:16Z  in response to brock_smith
    Currently i am following the 41 sample module what setting should be in application descriptor.xml file for Iphone application!
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: IOS push notification

    ‏2013-01-07T14:17:54Z  in response to brock_smith
    Hi,
    You need to:

    • Make sure you have a Mac, otherwise you cannot continue.
    1. You must be a registered Apple iOS Developer in order to obtain an Apple APNS certificate for your application. An APNS certificate must have a nonblank password.
    2.ƒ Rename you certificate file to "apns-certificate-sandbox.p12" and put it in the application root folder.
    3. Provide the password for your push notifications certificate; to do so, add the pushSender child element to the iphone element in application-descriptor.xml like this:
    
    <iphone bundleId=
    "com.testapp" version=
    "1.0"> <pushSender password=
    ""/> <worklightSettings include=
    "true"/> <security> <encryptWebResources enabled=
    "false"/> <testWebResourcesChecksum enabled=
    "false" ignoreFileExtensions=
    "png, jpg, jpeg, gif, mp4, mp3"/> </security> </iphone>
    

    4. Build and deploy app and adapter
    5. Move to Xcode; setup your project
    6. Run on device
    7. Login with some username
    8. Click on the Subscribe button and make sure you receive a proper response
    9. Use the JAR file as specified in the training module in order to push the notification to the username you used to login with

    I suggest you start with step 1 to 4; once you do all these successfully we can move on to Xcode (which is outside of the Worklight scope).

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • brock_smith
    brock_smith
    42 Posts
    ACCEPTED ANSWER

    Re: IOS push notification

    ‏2013-01-07T16:21:44Z  in response to brock_smith
    Would you please send me the link which will me guide to get APNS certificate
    Thanx
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: IOS push notification

    ‏2013-01-07T16:32:17Z  in response to brock_smith
    This looks like a good guide: http://quickblox.com/developers/How_to_create_APNS_certificates

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • brock_smith
    brock_smith
    42 Posts
    ACCEPTED ANSWER

    Re: IOS push notification

    ‏2013-01-09T11:39:20Z  in response to brock_smith
    Hi Sir,
    i have generated apns-dev-cert.p12 as per suggested link, then i locate my certificate to app directory
    •Project
    ◦app1
    ■android
    ■iphone
    ■...
    ■...
    ■apns-dev-cert.p12 file.

    Now i am getting error at <worklightsetting>
    
    <iphone bundleId=
    "com.testapp" version=
    "1.0"> <pushSender password=
    "user_passwordwhendefiningthe .p12 certificate"/> <worklightSettings include=
    "true"/> <security> <encryptWebResources enabled=
    "false"/> <testWebResourcesChecksum enabled=
    "false" ignoreFileExtensions=
    "png, jpg,jpeg, gif, mp4, mp3"/> </security> </iphone>
    

    for clearification what is the meaning of bundleId is there any link or we have to modify as per requirement
    Thanx in Advance
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: IOS push notification

    ‏2013-01-09T11:47:57Z  in response to brock_smith
    Make sure to rename the .p12 certificate.
    Rename you certificate file to "apns-certificate-sandbox.p12" and put it in the application root folder.

    The bundleId property is mainly there for Xcode. In it you place your bundle identifier per your Apple Developer settings.
    bundle identifier A unique identifying string used to locate an application’s bundle at runtime.
    The value you place there will be copied to the generated Xcode project.
    It is also required if you choose to use the Authenticity challenge in your application.

    You can also search for "bundleid" in the IBM Worklight Information Center.
    http://pic.dhe.ibm.com/infocenter/wrklight/v5r0m5/index.jsp

    Either way, it is required.

    To understand what your bundleId should be, I recommend reading about Xcode development;
    This may be a good place to start in regards to this issue: http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/DevPortalGuide/CreatingandConfiguringAppIDs/CreatingandConfiguringAppIDs.html#//apple_ref/doc/uid/TP40011159-CH18-SW1

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • brock_smith
    brock_smith
    42 Posts
    ACCEPTED ANSWER

    Re: IOS push notification

    ‏2013-01-09T11:49:14Z  in response to brock_smith
    great thanx for a quick response, i am trying it and i am updating u.
  • brock_smith
    brock_smith
    42 Posts
    ACCEPTED ANSWER

    Re: IOS push notification

    ‏2013-01-09T12:03:36Z  in response to brock_smith
    Hi Adan,
    i renamed the .p12 certificate.
    "apns-certificate-sandbox.p12" and put it in the application root folder.
    I provided the bundleId property per your Apple Developer settings.

    but i am getting the same error
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: IOS push notification

    ‏2013-01-09T12:10:46Z  in response to brock_smith
    This is how it should be, sorry:

    
    <iphone bundleId=
    "com.testapp" version=
    "1.0"> <worklightSettings include=
    "true"/> <pushSender password=
    ""/> <security> <encryptWebResources enabled=
    "false"/> <testWebResourcesChecksum enabled=
    "false" ignoreFileExtensions=
    "png, jpg, jpeg, gif, mp4, mp3"/> </security> </iphone>
    


    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • brock_smith
    brock_smith
    42 Posts
    ACCEPTED ANSWER

    Re: IOS push notification

    ‏2013-01-09T12:41:54Z  in response to brock_smith
    hi Adan,

    the error has removed, now i have deployed app on my ipad when iam getting 4 button 2 enabled(isPushedSupport,isSubscribed) and 2 disabled(Subscribe,Unsubscribe).

    when i clicking isPushedSuport it pop true while return false when isSubscribed is clicked?
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: IOS push notification

    ‏2013-01-09T13:09:23Z  in response to brock_smith
    Silly question... after logging in to the app, have you first tapped on "Subscribe" prior to tapping on "isSubscribed"?

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • brock_smith
    brock_smith
    42 Posts
    ACCEPTED ANSWER

    Re: IOS push notification

    ‏2013-01-16T14:04:31Z  in response to brock_smith
    Hi Adan,

    i have got apns certifacate called apns-certificate-sandbox.p12(following the Provisioning development Provisioning Profile).

    Now i want to upload this application to app store. for this i created Distribution Provisioning Profile based on
    Distributed Method App Store
    Profile abcProfile
    App Id abcApplication

    Submit.

    In distribution is shows status active and action is Download.

    Problem:

    In Xcode Window Organizer Library Provisioning Profiles: when i refresh i go the profile with status:Valid signing identity not found.

    How do resolve it?

    App id that
    • SystemAdmin
      SystemAdmin
      2327 Posts
      ACCEPTED ANSWER

      Re: IOS push notification

      ‏2013-01-17T19:52:07Z  in response to brock_smith
      Hello,

      "Valid signing identity not found" is now an XCode/iOS Provisioning issue and not a Worklight issue. This is normally caused by a misstep in the provisioning profile created for your application. Does the bundle id for the provisioning profile match that of your app id? You may want to try a google search for the error you are getting as there are a number of solutions for this issue that several people have also run into.