Goal:
Hall monitors at a large school can scan student ID and easily enter tardy information in PowerSchool.
Limitations:
-I get no access to PowerSchool due to legal limitations
-Can't pass ID as a parameter into the URL because database ID differs from student ID. I could get a list, but with the acquisition of new students and everything, this would be hard to maintain.
My idea:
Create an app that scans the barcode, copies the student ID to the clipboard, immediately opens up a WebView to have the user sign in, and they can tap and hold to paste the ID into the user lookup field.
However, this is highly inefficient and a last resort. Is there any way to improve this given the extreme limitations I have?
Thanks so much in advance.
Pulling in a barcode is fairly simple. I think you're probably on the right track with opening a webview, but depending on the URL structure, you may even be able to modify the html body to automatically input the scanned barcode into the necessary field.
3 options I can think of:
1) The webpage you're loading, does it recall the previously used login from a cookie? If it uses one to auto populate the field, modify the saved cookie before loading the webview.
2) If a cookie isn't used, see if you can populate the form once the page has finished loading
3) This is the most ambitious. If you know the structure used for the form, and don't need the student to enter a password, send the form data instead of opening the login page. Here's an example of manually populating and sending a form using Paypal:
NSMutableURLRequest *urlRequest = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://mobile.paypal.com/cgi-bin/webscr"]];
NSString *body = [NSString stringWithFormat:@"cmd=_xclick&business=paypal@example.com&image_url=https://example.com/logo.jpg&no_shipping=2&no_note=1&amount=%1.2f¤cy_code=USD¬ify_url=https://example.com/paypalipn.cfm&return=http://example.com/", [self.orderAmount floatValue]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];
self.webView.delegate = self;
[self.webView loadRequest:urlRequest];
Of course, that means you'll have to dissect the sign in page and pull the form URL and data format, but that should help make it much easier on the hall monitors in the end.