ml-archive / push-urban-airship

Send push notifications using Urban Airship ✉️
MIT License
6 stars 2 forks source link

Feature/chaining methods #12

Closed rasmusebbesen closed 6 years ago

rasmusebbesen commented 6 years ago

This is a work in progress.

This branch aims to establish a convenient way to setup the payload for Urban Airships push payload. At this point the only option we have is to define the entire payload in a JSON object and inject that into the request. With this branch it'll be possible set each segment of the payload individually through method chaining as suggested in issue #10 eg.

let builder = UABuilder()

_ = try builder.audience(predefined: .all)
    .deviceTypes(compound: [.ios, .android])
    .notification(alert: "Hello world")

Checklist

codecov[bot] commented 6 years ago

Codecov Report

Merging #12 into master will increase coverage by 42.73%. The diff coverage is 97.35%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #12       +/-   ##
===========================================
+ Coverage       0%   42.73%   +42.73%     
===========================================
  Files           7       15        +8     
  Lines         195      344      +149     
  Branches        0        6        +6     
===========================================
+ Hits            0      147      +147     
- Misses        195      197        +2
Impacted Files Coverage Δ
Sources/UAPusher/UAManager.swift 0% <ø> (ø) :arrow_up:
Sources/UAPusher/UAResponse.swift 0% <0%> (ø)
Sources/UAPusher/Builder/Options.swift 100% <100%> (ø)
Sources/UAPusher/Builder/Campaigns.swift 100% <100%> (ø)
Sources/UAPusher/Builder/UABuilder.swift 100% <100%> (ø)
Sources/UAPusher/Builder/Audience.swift 100% <100%> (ø)
Sources/UAPusher/Builder/Message.swift 100% <100%> (ø)
Sources/UAPusher/Builder/Notification.swift 100% <100%> (ø)
Sources/UAPusher/Builder/DeviceTypes.swift 100% <100%> (ø)
Sources/UAPusher/Builder/InApp.swift 100% <100%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d45bbc6...1f83ac4. Read the comment docs.