forked from armin/zendesk-iphone-dropbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Integration.txt
49 lines (30 loc) · 2.33 KB
/
Integration.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Integration guide for ZendeskDropbox
-----------------------------------------
ZendeskDropbox is the Cocoa implementation of the web-based Zendesk dropbox (http://blog.zendesk.com/blog/2009/01/instant-support-access-with-drop-box.html).
You can integrate the library to your application so that your app users can send support request directly from within the application.
ZendeskDropbox is a simple class with one single instance method.
- (void)sendTicket:(NSDictionary *)ticketInfo
sendTicket is an async method. It returns immediately after this method is called. It will not wait until the ticket is submitted to Zendesk server.
In order to get notified about the status of ticket submission, you can implement the delegate methods in ZendeskDropboxDelegate informal protocol.
- (void)submissionConnectedToServer:(ZendeskDropbox *)connection;
- (void)submissionDidFinishLoading:(ZendeskDropbox *)connection;
- (void)submission:(ZendeskDropbox *)connection didFailWithError:(NSError *)error;
All methods in the protocol are optional. They behave very similar to the NSURLConnection delegate methods.
Please refer to ZendeskDropbox.h header file for the interface of the class.
Integration instructions
------------------------------------------
1. Add ZendeskDropboxLib to your project.
2. Open Info.plist in your project. Add the key "ZDURL" and put the URL of your Zendesk account there. E.g. "example.zendesk.com"
3. Optionally specify the tag for tickets (the default is dropbox) In Info.plist add the key "ZDTAG" and put a tag . E.g. "iphone"
4. Implement the ticket input form. You have to build your own UI for users to enter information and submit the ticket.
The sample code uses a UITableView to implement a Mail-like interface for ticket input. Please refer to ZendeskDropboxSampleViewController.m for details.
Dropbox supports only the following fields:
- email
- subject
- description
4. Implement ticket sending code:
ZendeskDropbox *ticketSubmission = [[ZendeskDropbox alloc] init];
ticketSubmission.delegate = self;
sendButton.enabled = NO;
[ticketSubmission sendTicket:[NSDictionary dictionaryWithObjectsAndKeys:descriptionView.text, ZendeskDropboxDescription, emailView.text, ZendeskDropboxEmail, subjectView.text, ZendeskDropboxSubject, nil]];
5. Implement the delegate methods. This is optional. Please refer to sample code for details.