In the next beta of Blocs 6.4.3 (beta build 2) we have added support to call Magic URLs directly from a custom Bric.
Using the new magic API call, you can do some pretty interesting new things. ![]()
Magic Classes
You can add custom classes to projects directly from your Custom Bric, via a Magic Class URL.
Example:
window.webkit.messageHandlers.magic.postMessage("https://blocsapp.com/magic/?r=add/class&data=eyJicmVha3BvaW50LTIiOltdLCJicmVha3BvaW50LTMiOltdLCJicmVha3BvaW50LTQiOltdLCJuYW1lIjoibXVzaWMiLCJicmVha3BvaW50LTEiOlt7Im5hbWUiOiIubXVzaWMiLCJydWxlcyI6ImJhY2tncm91bmQ6bGluZWFyLWdyYWRpZW50KDU3ZGVnLCAjMDBGRjAwIDAlLCAjRkYwMDAwIDEwMCUpOyIsImJyZWFrcG9pbnQiOiIxIn1dLCJkZXNjcmlwdGlvbiI6Ik5vIERlc2NyaXB0aW9uIn0=");
Magic Install Links
You can also install additional Brics directly from a custom Bric using Magic Install Links.
window.webkit.messageHandlers.magic.postMessage("https://blocsapp.com/magic/?r=install&url=https%3A%2F%2Fblocsapp.com%2Fdownload%2Fbrics%2Ffancy-numbers%2FFancy%2520Numbers.bex");
Magic URLs triggered by custom Brics are handled locally, eliminating the need for a web browser and ensuring a smooth, seamless user experience.
We have plans to expand the possibilities of what Magic URLs can do in the future, so more exciting possibilities to come, using the magic API call.
Have fun ![]()