Last active
December 15, 2015 12:29
-
-
Save ChrisRisner/5260966 to your computer and use it in GitHub Desktop.
FeedbackService
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void insertFeedback(Feedback feedback, TableOperationCallback<Feedback> callback) { | |
mFeedbackTable.insert(feedback, callback); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) saveFeedback:(NSDictionary *)feedback | |
completion:(CompletionBlock) completion { | |
[self.feedbackTable insert:feedback completion:^(NSDictionary *result, NSError *error) { | |
[self logErrorIfNotNil:error]; | |
completion(); | |
}]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public FeedbackService(Context context) { | |
mContext = context; | |
try { | |
mClient = new MobileServiceClient("https://<YourMobileServiceUrl>.azure-mobile.net/", "<YourApplicationKey>", mContext); | |
mFeedbackTable = mClient.getTable(Feedback.class); | |
} catch (MalformedURLException e) { | |
Log.e(TAG, "There was an error creating the Mobile Service. Verify the URL"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(FeedbackService *) init { | |
// Initialize the Mobile Service client with your URL and key | |
MSClient *newClient = [MSClient clientWithApplicationURLString:@"https://<YourMobileServiceUrl>.azure-mobile.net/" | |
withApplicationKey:@"<YourApplicationKey>"]; | |
// Add a Mobile Service filter to enable the busy indicator | |
self.client = [newClient clientwithFilter:self]; | |
self.feedbackTable = [_client getTable:@"Feedback"]; | |
self.busyCount = 0; | |
return self; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment