Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Easily create and read Corona Warn App Check-In URLs

License

Notifications You must be signed in to change notification settings

bauer-kirch/cwa-event-registration-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bauer-kirch/cwa-event-registration-url

This PHP library allows generating Check-In URLs for the Corona Warn App which can then be used to generate a QR code from. Moreover, event details can be extracted from existing Check-In URLs.

This library does not generate a QR code image. A dedicated library for QR code generation can be used for that, either in PHP or client side using JavaScript. A QR code generated from the check-in URL will open the Corona Warn App on mobile devices.

Installation

composer require bauer-kirch/cwa-event-registration-url

Usage

Reading URLs

use BauerKirch\CoronaWarnAppEventRegistration\QRCodePayloadReader;

$url = 'https://e.coronawarn.app/?v=1#CAESR...';
$reader = new QRCodePayloadReader();
$result = $reader->readUrl($url);
echo $result->getDescription();

Generating URLs

use BauerKirch\CoronaWarnAppEventRegistration\LocationType;
use BauerKirch\CoronaWarnAppEventRegistration\QRCodePayloadGenerator;

$generator = new QRCodePayloadGenerator();
$url = $generator->generateQRCodeUrl(
    LocationType::permanentWorkplace(),
    'Bauer + Kirch GmbH',
    'Pascalstr. 57, 52076 Aachen',
    120 // default check-in time in minutes
);
echo $url;