Skip to content
This repository has been archived by the owner on Jan 10, 2020. It is now read-only.

Android device registration #8

Open
alexbaciu opened this issue Apr 29, 2014 · 23 comments
Open

Android device registration #8

alexbaciu opened this issue Apr 29, 2014 · 23 comments
Labels

Comments

@alexbaciu
Copy link

Hello,

I have a quick question about Android device registration: what is the endpoint url for registration requests? The same as the IOS one?

Thank you

@bassrock
Copy link
Member

No it is /device/gcm/app_open if you are using the 1.2fixes branch, otherwise it is not fully supported. I am working on upgrading the 1.2fixes branch, but have gotten sidetracked with other projects. Any pull requests are welcome to it.

@alexbaciu
Copy link
Author

Thank you for your answer!
I have a problem with installing this vendor on Symfony 2.3
I saw that it requires "sensio/framework-extra-bundle": "~3.0" satisfiable by Symfony 2.4. Is there a way to install it for Symfony 2.3 ?

@bassrock
Copy link
Member

bassrock commented May 7, 2014

Hmm looking at the changelog for Sensio framework extra bundle I may be able to change the dependency to 2.1 I will look at this tonight and see if anything breaks.

@bassrock
Copy link
Member

bassrock commented May 8, 2014

@alexbaciu actually if you use "dabsquared/dabsquared-push-notifications-bundle": "dev-fixes/1.2" you won't have that constraint and you will actually have better android support as I am in the middle of adding it and am about to commit some changes to here in the next few hours.

@bassrock
Copy link
Member

bassrock commented May 8, 2014

@alexbaciu let me know if the lastet commits on the 1.2 branch works for you.

@alexbaciu
Copy link
Author

@bassrock it worked ok, thank you. I will start using this right now.

@alexbaciu
Copy link
Author

It seems to be some problems after the composer runs ok:

  1. dab_push_notifications configuration key needs to be changed into: dab_squared_push_notifications
  2. andoid.gcm.api_key is not known
  3. after solving those problems i receive this:

"InvalidConfigurationException: The child node "appevent" at path "dab_push_notifications.class.model" must be configured"

Can you advice please?

@bassrock
Copy link
Member

bassrock commented May 8, 2014

Yea the new version uses a new app event class to starry monitoring when people open close and terminate your app. The docs should show you how to setup the new class in the "creating your classes" section. If not guess I missed some docs!

On May 8, 2014, at 4:47 AM, alexbaciu [email protected] wrote:

It seems to be some problems after the composer runs ok:

dab_push_notifications configuration key needs to be changed into: dab_squared_push_notifications
andoid.gcm.api_key is not known
after solving those problems i receive this:
"InvalidConfigurationException: The child node "appevent" at path "dab_push_notifications.class.model" must be configured"

Can you advice please?


Reply to this email directly or view it on GitHub.

@alexbaciu
Copy link
Author

Ok, please notify me, if you can, when new documentation is available.

@bassrock
Copy link
Member

bassrock commented May 8, 2014

@alexbaciu it is right here: https://github.com/DABSquared/DABSquaredPushNotificationsBundle/blob/fixes/1.2/Resources/doc/2-mapping_orm.md

When reading the docs make sure you are on the 1.2 branch as it has been mostly updated.

@alexbaciu
Copy link
Author

Hello, I've added the new entity, but right now I have a new problem:

InvalidConfigurationException: The child node "apps" at path "dab_push_notifications" must be configured.

@bassrock
Copy link
Member

bassrock commented May 9, 2014

@alexbaciu
Copy link
Author

Thank you, the installation went ok now. There is an error when I am trying to update the database structure starting from the new created entities:

php app/console --env=dev doctrine:schema:update --dump-sql

PHP Fatal error: Declaration of DABSquared\PushNotificationsBundle\Model\Device::addMessage() must be compatible with that of DABSquared\PushNotificationsBundle\Model\DeviceInterface::addMessage() in /..../Symfony/vendor/dabsquared/dabsquared-push-notifications-bundle/DABSquared/PushNotificationsBundle/Model/Device.php on line 18

@bassrock
Copy link
Member

@alexbaciu i Just implemented some changes, let me know if you still have a problem with that.

@alexbaciu
Copy link
Author

Hello,

Now there is another problem:

guestmob@thinkcentre:/var/www/alex_guestmob/guestmobx/Symfony$ php app/console --env=dev doctrine:schema:update --dump-sqlPHP Fatal error: Declaration of DABSquared\PushNotificationsBundle\Model\Message::setDevice() must be compatible with that of DABSquared\PushNotificationsBundle\Model\MessageInterface::setDevice() in /.../vendor/dabsquared/dabsquared-push-notifications-bundle/DABSquared/PushNotificationsBundle/Model/Message.php on line 17

@bassrock
Copy link
Member

@alexbaciu go ahead and try now. Sorry for all the issues!

@alexbaciu
Copy link
Author

No problem. I will try to help you to make it stable. I am having another problem now:

  • with this device entity configuration:

namespace Acme\UserBundle\Entity;

use Symfony\Component\Validator\Constraints as Assert;
use DABSquared\PushNotificationsBundle\Entity\Device as BaseDevice;

use DABSquared\PushNotificationsBundle\Model\UserDeviceInterface;
use Symfony\Component\Security\Core\User\UserInterface;

use Doctrine\ORM\Mapping as ORM;

/**

  • @Orm\Entity

  • @Orm\ChangeTrackingPolicy("DEFERRED_EXPLICIT")

  • @Orm\HasLifecycleCallbacks()
    */
    class Device extends BaseDevice implements UserDeviceInterface
    {

    /**

    • Owner of the device
      *
    • @Orm\ManyToOne(targetEntity="\Acme\UserBundle\Entity\User")
    • @var User
      */
      protected $user;

    /**

    • @Orm\OneToMany(targetEntity="\Acme\UserBundle\Entity\Message", mappedBy="device")
      */
      protected $messages;

    /**

    • @Orm\OneToMany(targetEntity="\Acme\UserBundle\Entity\AppEvent", mappedBy="device")
      */
      protected $appEvents;

    /**

    • Constructor
      */
      public function __construct()
      {
      $this->messages = new \Doctrine\Common\Collections\ArrayCollection();
      $this->appEvents = new \Doctrine\Common\Collections\ArrayCollection();
      }

    /**

    • @Orm\PrePersist
      */
      public function PrePersist() {
      $this->createdAt = new \DateTime();
      $this->updatedAt = new \DateTime();

    }

    /**

    • @Orm\PreUpdate
      */
      public function PreUpdate() {
      $this->updatedAt = new \DateTime();
      }

    /**

    • Add message

    • @return Device
      */
      public function addMessage(\Acme\UserBundle\Entity\Message $message)
      {
      $this->messages[] = $message;

      return $this;
      }

I am receiving the following error:

PHP Fatal error: Declaration of Acme\UserBundle\Entity\Device::addMessage() must be compatible with that of DABSquared\PushNotificationsBundle\Model\DeviceInterface::addMessage() in ../src/Acme/UserBundle/Entity/Device.php on line 19

Probably the documentation below needs to be changed.

https://github.com/DABSquared/DABSquaredPushNotificationsBundle/blob/fixes/1.2/Resources/doc/2-mapping_orm.md

@bassrock
Copy link
Member

what does your \Acme\UserBundle\Entity\Message look like?

@alexbaciu
Copy link
Author

Hello my Message class looks like this:

createdAt = new \DateTime(); $this->updatedAt = new \DateTime(); } /** - @Orm\PreUpdate */ public function PreUpdate() { $this->updatedAt = new \DateTime(); } /** - @Orm\ManyToOne(targetEntity="\Acme\UserBundle\Entity\Device", inversedBy="messages") */ protected $device; /** - Get id * - @return integer */ public function getId() { return $this->id; } /** - Get device * - @return \Acme\UserBundle\Entity\Device */ public function getDevice() { return $this->device; } }

@bassrock
Copy link
Member

hmm ok. It looks like the interface classes aren't inheriting down. Is it possible for you to fork, fix and submit a pull request?

@alexbaciu
Copy link
Author

Hello,
Sorry for this delay.

  1. I've manage to install and create the database tables for the bundle
  2. I see that the documentation for messages is not actualized. For instance the creation of the message requires "type" to be specified. Can you advice please?
  3. When I am trying to go to admin interface I have this error:

FatalErrorException: Error: Call to a member function set() on a non-object in /var/www/...../Symfony/vendor/dabsquared/dabsquared-push-notifications-bundle/DABSquared/PushNotificationsBundle/Controller/PushAdminController.php line 98
I have the sessions enabled
Can you help me, please?

Thank you!

@bassrock
Copy link
Member

Ah! I didn't think, but you need to configure JMSDIExtra Bundle appropriately, something like this:

jms_di_extra:
    locations:
        all_bundles: false
        bundles: [DABSquaredPushNotificationsBundle]
        directories: ["%kernel.root_dir%/../src"]

If you want to submit a pull request to remove this dependency I would be happy to merge it.

@alexbaciu
Copy link
Author

Ok, thank you.

  1. One other bundle that was needed for the admin interface was KnpPaginatorBundle
  2. I'd like first to make the entire bundle working on my local version and then see what can I do for improvements. Can you please send me the new sample codes for sending messages on IOS and GCM individual and mass?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants