Code Monkey home page Code Monkey logo

onesignal-ruby's People

Contributors

bernardini687 avatar chrismaximin avatar dependabot[bot] avatar fkapsahili avatar gabriel-dehan avatar gdeglin avatar hotatekaoru avatar joecorcoran avatar jongirard avatar matteojoliveau avatar mtayllan avatar reachire-smendola avatar regedarek avatar rgould avatar sokre95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onesignal-ruby's Issues

Bump version needed

This is the 0.3.0 onesignal.rb module definition, which is different from the latest in the repo (it's missing the configure method for example). My guess is that whoever is using this is referencing the repo?


require 'onesignal/version'
require 'onesignal/client'
require 'onesignal/request'
require 'onesignal/request_error'
require 'onesignal/app_id_missing_error'
require 'onesignal/models/base_model'
require 'onesignal/models/app'
require 'onesignal/models/player'
require 'onesignal/models/notification'
require 'onesignal/resources/base_resource'
require 'onesignal/resources/app_resource'
require 'onesignal/resources/player_resource'
require 'onesignal/resources/notification_resource'

module OneSignal
  DEVICE_TYPES = %w(
    ios android amazon mpns chrome_app chrome_website wns safari firefox
  ).freeze

  def self.device_type_as_integer(device_type)
    DEVICE_TYPES.index(device_type)
  end
end```

private method `define_method'

NoMethodError: private method `define_method' called for OneSignal::Notification::Headings:Class

error showing when I call

OneSignal::Notification::Headings.new(en: 'Hello!', it: 'Ciao!')

doing this in OneSignnal::Automap fixes it, is this the right way?

def create_readers **attributes
      attributes.keys.each do |k|
        self.class.send(:define_method, k) do
          attributes[k]
        end
    end
end

Also in response

NoMethodError: private method `attr_reader' called for OneSignal::Responses::Notification:Class

usinng the mattr_reader instead attr_reader fixes it in OneSignal::Responses::BaseResponse. is this the right way?

def initialize attributes = {}
        @attributes = attributes.deep_symbolize_keys
                                .keep_if { |k, _v| self.class::ATTRIBUTES_WHITELIST.include?(k.to_sym) }
        self.class.mattr_reader(*self.class::ATTRIBUTES_WHITELIST)
      end

ERROR: Could not find a valid gem 'onesignal-ruby

gem install onesignal-ruby, '~> 0.4'
ERROR: Could not find a valid gem 'onesignal-ruby,' (>= 0) in any repository
ERROR: Possible alternatives: onesignal-ruby, one_signal, onesignal, EsignRuby, functional-ruby
ERROR: Could not find a valid gem '~> 0.4' (>= 0) in any repository

Rails 6.0.2

Support for rails 7

onesignal-ruby currently pins rails between 5-6, but 7.0.1 is out:

    onesignal-ruby was resolved to 0.6.0, which depends on
      activesupport (>= 5.0.0, < 7)

This is not a real issue It's a question

Hi, Thank you all for this amazing Gem. Actually this is not an issue. Is there any example or possible way of how to send a push notification to a single user using this gem?

OneSignal::Buttons not working

NameError (uninitialized constant OneSignal::Buttons)
OneSignal::Buttons not working please go through this is asap. Thanks

Sending push notification to exernal_users does not work anymore

When using "include_external_user_ids" I'm getting this error:

could not send push notification Platforms You may only send to one delivery channel at a time. Make sure you are only including one of push platforms, Email, or SMS.

According to the API documentation "channel_for_external_user_ids" must be set to 'push', 'email' or 'sms', but the gem doesn't seem to support this.

ETA for push on rubygems

Hello!

Great work and great gem, was wondering if you could deploy it on rubygems? It'd be nice to have a master branch too :P
Also, in the readme, it'd be rather helpful to add that you need to require 'onesignal' in your initializer :)

Cheers

rename OneSignal.define as Onesignal.configure

While there is nothing inherently wrong with using OneSignal.define I think that Onesignal.configure would be a slightly better choice.

According to the principle of least surprise many developers may be already accustomed to configure as many other Ruby libraries use the same method name for that configuration pattern (Rails, Rspec, Capybara, Rollbar, Solidus just to name a few I can recall).

Of course in order to make things easier and avoid breaking any existing code the define method could be simply aliased to configure.

Can't install the gem using Rails 6

Hi, I'm trying to install the gem in my Rails 6.0.0 project and I'm getting the following error:

~$ bundle
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "activesupport":
In snapshot (Gemfile.lock):
activesupport (= 6.0.0)

In Gemfile:
onesignal-ruby (~> 0.3.0) was resolved to 0.3.0, which depends on
activesupport (>= 5.0.0, ~> 5.0)

rails (~> 6.0.0) was resolved to 6.0.0, which depends on
  activesupport (= 6.0.0)

Running bundle update will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

I just found this gem and it looks promising! thanks in advance.

Faraday versions

The current stable version of faraday is 1.1.0 but, in this project that one is ~> 0.15, >= 0.15.4.

Can you update the dependencies?

Use CircleCI for pipelines

Our current company plan doesn't support Actions at the moment.
We'll revert back to CircleCI for integration pipelines.

fetch_player not working?

version is 0.6.0

-> OneSignal.fetch_player(player_id)
Traceback (most recent call last):
ArgumentError (wrong number of arguments (given 2, expected 1))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.