Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8209177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:37:51+00:00 2026-06-07T09:37:51+00:00

Working scenario: When I run my app from xcode directly to my device I

  • 0

Working scenario: When I run my app from xcode directly to my device I can run a push notification on the server and it works just as expected.

Non-working scenario: I export the app to an IPA and install the app on my device via iTunes. When I push a notification from the server I’ll get the error of ERROR: Unable to send message ID 1: Invalid token (8).

While writing this post I had a thought and checked the device id when it came from the xcode install vs the IPA install and they are different!

code for sending the device id to my server:

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    // You can send here, for example, an asynchronous HTTP request to your web-server to store this deviceToken remotely.

    // convert token to a single string
    NSString *token = [[[deviceToken description]
                        stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]] 
                       stringByReplacingOccurrencesOfString:@" " 
                       withString:@""];

    NSString *post = [NSString stringWithFormat:[NSString stringWithFormat:@"token=%@", token]];
    NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];

    NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];

    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
    [request setURL:[NSURL URLWithString:@"http://mywebsitename.com/ApnsPHP/add.php"]];
    [request setHTTPMethod:@"POST"];
    [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
    [request setHTTPBody:postData];

    [NSURLConnection sendAsynchronousRequest:request queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error){
        dispatch_async(dispatch_get_main_queue(), ^{
            NSError *e = nil;
            NSDictionary *dict = [XMLReader dictionaryForXMLData:data error:&e];
            NSLog(@"response from server: %@", dict);
        });
    }];

    NSLog(@"Did register for remote notifications: %@", deviceToken);
}

How can I get it so that the device token from the IPA distribution goes through? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:37:53+00:00Added an answer on June 7, 2026 at 9:37 am

    I was perusing related questions when I found this question about push notes. I thought about the idea and started checking out things from top to bottom. I finally found this:

    Apple Push Notification Developer View

    Hopefully the problem is as apparent to you as it was to me, but I understand if it’s not. APNs will not work with an IPA unless the status for the Production Push SSL Certificate is Enabled.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario: My installation of SQL Server 2008 Web Edition SP1 was working properly. Since
Scenario : I am working on LOB application, as in silverlight every call to
Here's my scenario - I am working with SL3 (and WCF Data Services) and
Im searching for the best practice (or any working solution) for the following scenario:
I have a scenario, working on iPhone development. I got 3 threads , 2
I'm working with cucumber and I'm running into difficulties. When I run cucumber features,
I can't figure out why FirsViewController is not destroyed/releasedd in this scenario. My AppDelegate.m
Scenario is such: I have a webapp that I'd like to run dynamically with
I am working on development of an embedded Linux device which needs to exchange
I'm working on a hybrid OpenCL application that has to decide at run time

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.