Sha256: 2f056559390b9785380ae3adcbb8083d30ceb4a81a7df76b3d3486c6018e87ba

Contents?: true

Size: 605 Bytes

Versions: 5

Compression:

Stored size: 605 Bytes

Contents

# frozen_string_literal: true

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))

require 'rubygems'
require 'ncmb'
require 'yaml'
yaml = YAML.load_file(File.join(File.dirname(__FILE__), '..', 'setting.yml'))
NCMB.initialize(
  application_key: yaml['application_key'],
  client_key: yaml['client_key']
)

@push = NCMB::Push.new
@push.immediateDeliveryFlag = true
@push.target = ['ios']
@push.message = 'This is test message'
@push.deliveryExpirationTime = '3 day'
if @push.save
  puts 'Push save successful.'
else
  puts 'Push save faild.'
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ncmb-ruby-client-0.2.0 examples/push.rb
ncmb-ruby-client-0.1.7 examples/push.rb
ncmb-ruby-client-0.1.6 examples/push.rb
ncmb-ruby-client-0.1.5 examples/push.rb
ncmb-ruby-client-0.1.4 examples/push.rb