title: Braintree Client token is invalid
body: <p>I am able to generate the client token but it says BTClient could not initialize because the provided clientToken was invalid' when i use  on iOS client side </p>
  
  <p>Server side code is in php :-</p>
  
  <pre><code>$encodedClientToken = Braintree_ClientToken::generate();
  echo (  $clientToken = base64_decode($encodedClientToken));
  </code></pre>
  
  <p>Edit 1:-
  Here I just want to mimic getting client token (like braintree has done here <a href="https://braintree-sample-merchant.herokuapp.com/client_token" rel="nofollow">https://braintree-sample-merchant.herokuapp.com/client_token</a>) from our server
  I followed your instruction to create simple server from here <a href="https://developers.braintreepayments.com/ios+php/start/hello-server" rel="nofollow">https://developers.braintreepayments.com/ios+php/start/hello-server</a>, and my file generates the client token as well but when i use in my iOS app it give me error that "BTClient could not initialize because the provided clientToken was invalid"</p>
  
  <p>here is my iOS Code </p>
  
  <pre><code>NSURL *clientTokenURL = [NSURL URLWithString:@"http://192.168.1.1:8888/gettoken.php"];
      NSMutableURLRequest *clientTokenRequest = [NSMutableURLRequest requestWithURL:clientTokenURL];
      [clientTokenRequest setValue:@"text/plain" forHTTPHeaderField:@"Accept"];
  
      [NSURLConnection
       sendAsynchronousRequest:clientTokenRequest
       queue:[NSOperationQueue mainQueue]
       completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
           // TODO: Handle errors in [(NSHTTPURLResponse *)response statusCode] and connectionError
           NSString *clientToken = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
  
           // Initialize `Braintree` once per checkout session
           self.braintree = [Braintree braintreeWithClientToken:clientToken];
  
           // As an example, you may wish to present our Drop-In UI at this point.
           // Continue to the next section to learn more...
       }];
  </code></pre>