Gzip in Ionic v2

Well i’m looking to build an app with Ionic v2. The main goal is to read a QR-Code which is gzip compressed…

I’ve already seen in this post: Cordova GZip decompression doesn’t work
gzip compression and decompression should be doable with ionic.

My Question is, is it possible to use gzip in Ionic v2 and if it’s do able does someone have a code sniped to show how it’s done?

Thanks a lot in advance. I really hope it is possible i’d love to use Ionic 2 for my application.

The string looks like this:

Header part: CHMED16A1
Content: H4sIAAAAAAAEAK1UzW7aQBB+lY2vsaNd24DNLQmhRQktIrSRWuWwtge8wl6j9bpNQLxNHqO3vF… 4 more lines like this… :wink: just for the understanding …

The result should be json.

Best Regards

this has nothing to do with ionic2… it is a javascript issue.

instead of using serverside compression you should store frontend compatible code in the qr-code.

Real compression with javascript:

Hmm so i’ve got a problem… The QR-Code is given me form an external partner…
So there is no possibility to do a workaround? I’d really like to use Ionic but i can’t change the data stored on the QR-Code…

if you are familiar with java and swift --> create a little cordova plugin, which compress/decompresses gzip ;).

So you make the effort and some other people can use it.

In this case you only need to build a small piece of your app in platform dependent technologies :wink: and the layout and anything else is written in ionic2/angular2

Shit, i am not familiar with java and swift… :blush: … but thanks a lot for the help!

in other cases try javascript libs, which tries to implement the gzip standard ;). Maybe one of them are working:


Yeah that’s what i’m trying right now… I just stumpled upon pako :wink: