问题
Problem to implement Gracenote api in iOS provide invalid User & manager not initialised .
GN_Entourage_Demo[24927:70b] getUserACR: ERROR: Manager not initialized 2014-03-10 19:05:20.509 GN_Entourage_Demo[24927:70b] Error: Invalid User (lldb) following problem when i am implement
// Initialize the Entourage SDK self.sdkManager = [[GnSdkManager alloc] initWithLicense:LICENSE_INFO error:nil];
self.acrUser = [self getUserACR];
if (!self.acrUser) {
NSLog(@"Error: Invalid User");
}
// Create a GnAcr object for this user
self.acr = [[GnACR alloc] initWithUser:self.acrUser error:nil];
// Set up an audio configuration
GnAcrAudioConfig *config =
[[[GnAcrAudioConfig alloc] initWithAudioSourceType:GnAcrAudioSourceMic
sampleRate:GnAcrAudioSampleRate44100
format:GnAcrAudioSampleFormatPCM16
numChannels:1] autorelease];
// Initialize the GnAcr's audio configuration
[self.acr audioInitWithAudioConfig:config];
// Initialize the audio source (i.e. device microphone)
self.audioSource = [[GnAudioSourceiOSMic alloc] initWithAudioConfig:config];
// Assign the delegates
self.audioSource.audioDelegate = self;
self.acr.resultDelegate = self;
self.acr.statusDelegate = self;
self.isListening = NO;
}
回答1:
The iOS code has a problem with whitespace/newlines in the LICENSE_INFO literal. What you need to do is replace newlines in your License String with '\n' (without the quotes), so that LICENSE_INFO is just one long line. The error should go away.
We've updated the docs with this note https://developer.gracenote.com/how-build-simple-entourage-application-ios
Thanks, and sorry for the inconvenience!
来源:https://stackoverflow.com/questions/22831788/gracenote-error-invalid-user