1

Is it possible to associated some specific user id with someone who views an iBook generated from iBooks Author?

A simple example may clarify the question. Imagine you build an HTML5 Widget that provides a true false question, and you have something in the widget the posts the results to some server. For that post to be meaningful, you would want to know who posted it. Is there some way to extract that information, something to do with some account details of the owner of the iBook perhaps?

1 Answer 1

1

HTML widgets are not supposed to get access to the system.

One approach is to use local storage. The storage is per book. If you store some data in one widget, you can read it from another one in the book. The solution then is to create a 'registration' HTML widget, shown early in the book. Simple input form to gather basic data. Add a submit button and use some javascript to get the form data saved in local storage (localStorage.userName = 'Joe'). The user only has to provide registration information the first time he opens the book.

Other HTML widgets can access the information from localstorage (var userName = localStorage.userName).

1
  • thanks so much for that suggestion. It makes a lot of sense, and your help is much appreciated
    – leoshmu
    Commented Apr 8, 2012 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.