In the example php is URL encoding, the ObjectiveC is not.
Best to start with a simple example, short strings and skip the base64 encoding on both, Then compare results. When this works start adding the additional operations such as url encoding and base 64.
For php start with: echo hash_hmac('sha1', 'test string', 'secret'); and the same in objc.
Here is a starting point that matches php:
NSString* phpsignatureData = @"dd26bfddf122c1055d4cd5b054227727e1e3eecf";
NSLog(@"phpsignatureData: %@", phpsignatureData);
NSData* secretData = [@"secret" dataUsingEncoding:NSUTF8StringEncoding];
NSData* stringData = [@"test string" dataUsingEncoding:NSUTF8StringEncoding];
NSMutableData *signatureData = [NSMutableData dataWithLength:CC_SHA1_DIGEST_LENGTH];
CCHmac(kCCHmacAlgSHA1, secretData.bytes, secretData.length, stringData.bytes, stringData.length, signatureData.mutableBytes);
NSLog(@"secretData %@", secretData );
NSLog(@"stringData %@", stringData );
NSLog(@"signatureData %@", signatureData );
NSLog output:
phpsignatureData: dd26bfddf122c1055d4cd5b054227727e1e3eecf secretData <73656372 6574> stringData <74657374 20737472 696e67> signatureData <dd26bfdd f122c105 5d4cd5b0 54227727 e1e3eecf>